Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用 ember.js 在 URL 中添加全局语言代码前缀?例如
/#/en/about /#/de/about
换句话说
/#/{language_code}/whatever/is/there/...
当然,您可以将您的路线嵌套在lang这样的资源中。
lang
App.Router.map(function() { this.resource('lang', { path: '/:lang_id' }, function() { this.route('about'); }); });
然后,您可以使用这些路线,{{linkTo}}例如,
{{linkTo}}
{{#linkTo 'about' 'en'}}About (en){{/linkTo}} {{#linkTo 'about' 'de'}}About (de){{/linkTo}}