If you want to fast and painless create a multilingual app that uses angular, this is just for you!
- Dowload it
- Just run
bower install
and you're good to go
- HTML5Boilerplate
- angular
- angular-translate
- angular-ui-router
- and others - check out bower.json
Note: I'm using SASS, but you don't have to, just make changes in css/main.css file
Add the locales/locale
file, like locale-[LANG_CODE].json
and add the button in index.html
Example
Create locales/locale-it.json
{
"WELCOME": "benvenuto"
}
And in index.html
add the button
<ul data-ng-controller="translateController" id="lang-menu">
<li><span data-ng-click="changeLanguage('it')">Italian</span></li>
<!-- other buttons -->
</ul>
And when italian is selected, <p>{{"WELCOME" | translate}}</<p>
will become <p>benvenuto</p>
See the scss folder
See the loadingIcon directive
Feel free to contribute