Internationalize and Localize your Ionic 2 Application
Stavros Kounis
52

Thanks so much for the detailed and informative post. I just ran through it and had an issue with

import { Globalization } from ‘ionic-native’;

It looks like this has been replaced by

import { Globalization } from ‘@ionic-native/globalization’;

I had to install this by running

  • $ ionic cordova plugin add cordova-plugin-globalization
  • $ npm install --save @ionic-native/globalization

And update the constructor to

constructor(platform: Platform, translate: TranslateService, globalization: Globalization)

Finally I changed Globalization.getPreferredLanguage to globalization.getPreferredLanguage. Now it builds but my app is still hanging with warns about Forbidden ‘var’ keyword, use ‘let’ or ‘const’ instead. Maybe you know enough to fix whatever else is going wrong.

Show your support

Clapping shows how much you appreciated Matt H’s story.