Ember-i18n缺少翻译:它不适用于Ember Twiddle示例

时间:2017-03-02 21:22:37

标签: ember.js ember-i18n

我不知道为什么,但是不能让插件Ember-i18n工作,我该怎么做?

你可以在https://canary.ember-twiddle.com/736ba26820e429cd683a5eb54416996b?openFiles=routes.application.js%2C

下看到我的Ember Twiddle

1 个答案:

答案 0 :(得分:1)

All is ok but one point. The fallback language is en and you didn't define the default. Also you didn't define anywhere that the default lang is de.

Please do below in application route :

import Ember from 'ember';

export default Ember.Route.extend({
   i18n: Ember.inject.service(),

  beforeModel(){
    this.set('i18n.locale', 'de');
  }
});