Localization with ng2-translate


#1

Has anyone managed to use ng2-translate with angular2-meteor? Having integrated it (based on the ng2-translate readme) I am getting the following error in the browser:
SyntaxError: import declarations may only appear at top level of a module

Can anyone help me what the problem might be?


#2

Which version of Meteor are you using? Import declarations could only appear at the top level of a module up until Meteor 1.3.3. See the v1.3.3 section of the Meteor history file for more info:

import statements in application modules are no longer restricted to the top level, and may now appear inside conditional statements (e.g. if (Meteor.isServer) { import … }) or in nested scopes.


#3

We are using Meteor v1.4.1.1.


#4

Just to verify - are you sure your app is using 1.4.1.1 - what does it say in your MY_APP_ROOT/.meteor/release file?


#5

In a recent conference, John Papa said the Angular 2 team is going to publish a cookbook on how to use i18n core features in Angular 2 in the next weeks/months. Because in its core Angular 2.0 already has internationalization (i18n) support.


#6

For Angular 2’s i18n, you can track here: