Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

How to architect multilanguage routes with i18n

$
0
0

@oskar wrote:

I'm looking for advice on how to structure a multi language application using ember-i18n. I wasn't able to find many resources on this so any guidance would be greatly appreciated!

Routes should be localized and prefixed with the locale (unless it's the default). Like this:

  • news
  • es/noticias

The API can be namespaced with the locale as such:

  • api/news/5
  • es/news/5
  • /news/5?locale=es

I thought about nesting all routes in a:

this.route('locale', {path: ':locale}, function () { this.route('music'); }

… which would allow you to localize and redirect on the language route. But when you for instance transition to the route en.news the path would not end up being /news/ but /en/news/ (with locale). I need the default locale (en in this case) to not be prefixed.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles