Click here to Skip to main content
15,902,896 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to translate the title in navigation menu, but the title is customized in html. Here is the code:
var string = '13';
$scope.string123 = $filter('translate')(string);
  var test = "<p style='line-height:15px!important'>{{string123}}</br>klient/artikull</p>";
     msNavigationService.saveItem('apps.offers.priceperunitnew', {
            title: $interpolate(test)($scope),
            icon: 'icon-barcode',
            state: 'app.offers.priceperunitnew',
            hidden: function () {
                var priceforunitnew = true;
                if (localStorage.getItem("OfertaCmimNjesiNew") === '1')
                { priceforunitnew = false; }
                else { priceforunitnew = true; }
                return priceforunitnew;
            },
            weight: 8
        });

So string is the key value in JSON and test is the customizet title. I just want to translate the title with i18n but it returns me the key, in this case 13

What I have tried:

I tried to interpolate in controller but still does not work
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900