- setup a virtual environment
- pip install from requirements.txt
- bower install
- install Grunt
- npm install
Run from views.py (localhost:5000/fruits)
@babel.localeselector
def get_locale():
return 'fr'
Switch between 'en' and 'fr'. Babel handles the installing of languages.
$scope.translateFR = function () {
console.log('translating to french');
gettextCatalog.setCurrentLanguage('fr');
};
$scope.translateEN = function () {
console.log('translating to english');
gettextCatalog.setCurrentLanguage('en');
};
Go to localhost:5000/fruits-angular and click the EN and FR button to change between languages. Languages are read from the translation.js file that is compiled by the Grunt task nggettext_compile (see Gruntfile.js)