1

I would like to get translated url path in my application. Translation is working in every places in my application. Besides url of StateProvider. This is my code:

.state('about', {
        url: '/'+'{{"PATH.ABOUT.MAIN" | translate}}',
        templateUrl: 'views/about.html',
        controller: 'aboutController',
        activetab: 'about',
        ncyBreadcrumb: {
            label: '{{"PATH.ABOUT.MAIN" | translate}}',
            parent: 'home'                
        }
    })

Translation in ncyBreadcrumb is working fine but not in URL. I have also tried:

'/'+'{{"PATH.ABOUT.MAIN" | translate}}'

but this also doesnt work. Someone has any idea how to make my URL get translated?

Thanks!!

Thulion
  • 97
  • 1
  • 11
  • 1
    Have you tried using single curly brackets? see: [https://stackoverflow.com/questions/24281652/localize-urls-with-ui-router-and-angular-translate](https://stackoverflow.com/questions/24281652/localize-urls-with-ui-router-and-angular-translate) for suggestions. – Michael Nelson Sep 13 '17 at 20:19
  • Yes I have tried single brackets but with no success. Double brackets works likea a charm but not in URL section in StateProvider.. – Thulion Sep 13 '17 at 20:34
  • @Thulion Sorry was not able to provide an answer, but after an hour of seaching I found the plunkr, link [here](http://embed.plnkr.co/yleNY6alvqsEZ9dJfYSh/), In my opinion if the content of the website in the language needed its enough, no need to change the URL too!!! – Naren Murali Sep 14 '17 at 10:34
  • Thanks Naren! I have got this already. I want to be prepare if client will require this feature in app. I have not got good answer for this - As soon as I beat this problem I will copy my code in this topic. Thanks again for your time! – Thulion Sep 14 '17 at 11:14

0 Answers0