0

我们在项目中使用 ember-intl。但是,当我们使用 构建项目时ember build --environment=production,ember-intl 添加了 600 多个翻译文件。

我想选择我们支持的语言,我不想添加我们不需要的 17mb 的 json 文件。

有什么配置吗?

4

1 回答 1

1

将以下内容包含在config/environment.js.

intl: {
    locales: ['en-us', 'fr-fr']
 }

包含的示例 environment.js 文件将是,

var ENV = {
    modulePrefix: 'kuman-appname',
    environment: environment,
    baseURL: '/',
    locationType: 'auto',
    EmberENV: {
      FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. 'with-controller': true
      }
    },

    APP: {
      // Here you can pass flags/options to your application instance
      // when it is created
    },
    intl: {
       locales: ['en-us', 'fr-fr']
     }
  }

https://github.com/jasonmit/ember-intl/wiki/Intl.js-Polyfill#loading-files-from-assets

于 2016-10-06T11:14:42.197 回答