我收到了 ember-i18n (ember-i18n: 5.0.0) 的警告
我在 environment.js 中设置了 defaultLocale: 'en' (如 ember-i18n 文档中所提到的),但仍然是它的人口警告。
//环境.js
module.exports = function(environment) {
var ENV = {
modulePrefix: 'spotlight',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {}
},
APP: {
defaultLocale:'en',
}
};
if (environment === 'development') {
ENV.APP.RAISE_ON_DEPRECATION = true;
}
if (environment === 'test') {
ENV.baseURL = '/';
ENV.locationType = 'auto';
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
}
if (environment === 'production') {}
ENV.i18n = { defaultLocale: 'en' };
return ENV;
};
//package.json
{
"devDependencies": {
"ember-i18n": "5.0.0"
}
}
//app/initializer/i18n.js
import Ember from 'ember';
export default {
name: 'i18n',
after: 'ember-i18n',
initialize: function()
{
var application = arguments[1] || arguments[0];
application.inject('controller', 'i18n', 'service:i18n');
application.inject('route', 'i18n', 'service:i18n');
}
}
提前感谢您的帮助。