lundi 27 février 2017

How can I translate routes in ember-cli?

I create some routes in app/router.js

Router.map(function () {
    let i18n = this.service('i18n');
    this.route("lang", { path: '/:lang' }, function () {
        this.route('home', { path: '/', template: 'home' });
        this.route('about', { path: '/' + i18n.t('router.about'), template: 'about' });
        this.route('locales', { path: '/' + i18n.t('router.locations'), template: 'locales' });
    });
});

But the i18n translates only the first time.

How can I translate these routes by change language?

I'm using:

ember-cli: 2.11.1

node: 7.4.0




Aucun commentaire:

Enregistrer un commentaire