我试图了解如何国际化使用emberjs开发的网络应用程序.
我发现ember-i18n包我认为是一个很好的解决方案,但我无法理解如何使用它.
我有一个由3条路线组成的Ember应用程序:
router.route('territory', { path: 'localhost/app/territory/:tid' });
router.route('aggregator', { path: localhost/app/territory/:tid:/aggregator/:aid' });
router.route(territory, { path: 'localhost/app/territory/:tid/aggregator/:aid/item/:iid' });
可能的转换是从领土到聚合器,从聚合器到项目,从项目到子项目.子项使用相同的路径(第3个),只是更改路径模型中的iID值.
我创建了一个动作,允许用户使用某些逻辑移动到特定路径,最后运行命令:
model={
tid: "ttt"
aid: "aaa"
iid: "iii"
}
destination = 'item'; //the name of item route
controller.transitionToRoute(destination, model);
Run Code Online (Sandbox Code Playgroud)
如果我在项目路线中并且我想要移动到其他项目,则URL将更新,但不会更新页面的内容.显然,如果我使用生成URL刷新页面,内容将更新.
问题出在哪儿?在过渡方法中是不推荐使用,还是我必须使用不同的东西?
重要提示:我使用的是EmberJS - V1.0.0-RC.1