Issues using Localize.js and AngularJs

352 views Asked by At

Localize.js is causing problems when trying to translate contents included in an ng-repeat element.

The content that should be translated, is simply removed. No errors in the console.

The only way I found to make it working is putting Localize.setLanguage() within the Angular controller managing the content to be translated, and only there.

The point is that (for some specific reasons) I need to put Localize.setLanguage() before that point.

Any ideas why this is happening?

Edit - this is the relevant code:

This script is in the HTML head:

    <script>
        Localize.initialize({
            key: 'xxxxxxxx',
            rememberLanguage: false,
            saveNewPhrases: false,
            translateTitle: true,
            translateBody: true
        });
        Localize.setLanguage('en');
    </script>

where, 'en' is not the default language in Localize.js (which is 'it').

And this is the HTML in the body:

    <b ng-repeat="f in filtri" ng-cloak>
        <span class="filter__label filter__label--key">{{f.l}}</span><span class="filter__label filter__label--value" notranslate>{{f.v}}</span>
    </b>
0

There are 0 answers