How to use angular build-in i18n/l10n in an ionic app?


#1

Hello,

I would like to localize the dates in my app. According to the angular i18n guide all I need to do is to include the respective angular-locale_{locale id}.js in my index.html:

<html ng-app>
<head>
….
    <script src="angular.js"></script>
    <script src="i18n/angular-locale_de-de.js"></script>
….
 </head>
</html>

But somehow that doesn’t work for me:

<head>
….
    <script src="lib/ionic/js/ionic.bundle.js"></script>
    <script src="lib/ionic/js/angular/angular-locale_de-de.js"></script>
….
 </head>
</html>

Am I missing something or does it not work like that with ionic…maybe because angular.js is included in the ionic.bundle.js and not in my app’s index.html?

Would be grateful for any help.


#2

Turned out I had for some mysterious reasons a wrong angular-locale_de-de.js file containing weird html. With the right one everything works fine.

I should’ve checked that. Sorry for bothering