ember-intl adds 600+ json for different languages to the project while building

158 Views Asked by At

We are using ember-intl in our projects. But while we are building our projects with ember build --environment=production, ember-intl adds 600+ translations files.

I want to pick the languages that we support and I don't want to add 17mb of json files those we don't need.

Is there any configuration for that?

1

There are 1 best solutions below

0
Ember Freak On BEST ANSWER

Include the below in config/environment.js.

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

included sample environment.js file would be,

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