Skip to content
Permalink
Browse files

fix(intl): update the ember-intl config to the latest version

  • Loading branch information...
anehx committed Jun 17, 2019
1 parent 9dd9506 commit 41522fa5caa420b483591bbb7c395ea9bc90cfd3
Showing with 58 additions and 27 deletions.
  1. +58 −27 config/ember-intl.js
@@ -1,14 +1,14 @@
/*jshint node:true*/
"use strict";

module.exports = function(/* env */) {
module.exports = function(/* environment */) {
return {
/**
* The locales that our application supports.
* The locales that the application needs to support.
*
* This is optional and is automatically set if project stores translations
* where ember-intl is able to look them up (<project root>/translations/).
* NOTE: this is optional and is automatically set *if* you store translations
* within the `inputPath` defined below.
*
* If the project relies on side-loading translations, then you must explicitly
* If you side load translations, you must then explicitly
* list out the locales. i.e: ['en-us', 'en-gb', 'fr-fr']
*
* @property locales
@@ -18,8 +18,30 @@ module.exports = function(/* env */) {
locales: null,

/**
* autoPolyfill, when true will automatically inject the IntlJS polyfill
* into index.html
* Merges the fallback locale's translations into all other locales as a
* build-time fallback strategy.
*
* NOTE: a side effect of this option could result in missing translation warnings to be masked.
*
* @property fallbackLocale
* @type {String?}
* @default "null"
*/
fallbackLocale: null,

/**
* Path where translations are kept. This is relative to the project root.
* For example, if your translations are an npm dependency, set this to:
*`'./node_modules/path/to/translations'`
*
* @property inputPath
* @type {String}
* @default "'translations'"
*/
inputPath: "translations",

/**
* Automatically inject the Intl.JS polyfill into index.html
*
* @property autoPolyfill
* @type {Boolean}
@@ -28,7 +50,7 @@ module.exports = function(/* env */) {
autoPolyfill: false,

/**
* disablePolyfill prevents the polyfill from being bundled in the asset folder of the build
* Prevents the polyfill from being bundled in the asset folder of the build
*
* @property disablePolyfill
* @type {Boolean}
@@ -37,11 +59,11 @@ module.exports = function(/* env */) {
disablePolyfill: false,

/**
* prevents the translations from being bundled with the application code.
* Prevents the translations from being bundled with the application code.
* This enables asynchronously loading the translations for the active locale
* by fetching them from the asset folder of the build.
*
* See: https://github.com/jasonmit/ember-intl/blob/master/docs/asynchronously-loading-translations.md
* See: https://ember-intl.github.io/ember-intl/docs/guide/asynchronously-loading-translations
*
* @property publicOnly
* @type {Boolean}
@@ -50,36 +72,45 @@ module.exports = function(/* env */) {
publicOnly: false,

/**
* Path where translations are kept. This is relative to the project root.
* For example, if your translations are an npm dependency, set this to:
*`'./node_modules/path/to/translations'`
* Cause a build error if ICU argument mismatches are detected.
*
* @property inputPath
* @type {String}
* @default "translations"
* @property errorOnNamedArgumentMismatch
* @type {Boolean}
* @default "false"
*/
inputPath: "translations",
errorOnNamedArgumentMismatch: false,

/**
* cause a build error if missing translations are detected.
* Cause a build error if missing translations are detected.
*
* See https://github.com/jasonmit/ember-intl/blob/master/docs/missing-translations.md#throwing-a-build-error-on-missing-required-translation
* See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#throwing-a-build-error-on-missing-required-translation
*
* @property throwMissingTranslations
* @property errorOnMissingTranslations
* @type {Boolean}
* @default "false"
*/
throwMissingTranslations: false
errorOnMissingTranslations: false,

/**
* removes empty translations from the build output.
*
* @property stripEmptyTranslations
* @type {Boolean}
* @default false
*/
stripEmptyTranslations: false,

/**
* filter missing translations to ignore expected missing translations.
* Filter missing translations to ignore expected missing translations.
*
* See https://github.com/jasonmit/ember-intl/blob/master/docs/missing-translations.md#requiring-translations
* See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#requiring-translations
*
* @property requiresTranslation
* @type {Function?}
* @default "function() { return true; }"
* @type {Function}
* @default "function(key,locale){return true}"
*/
// requiresTranslation: (key, locale) => true
requiresTranslation(/* key, locale */) {
return true;
}
};
};

0 comments on commit 41522fa

Please sign in to comment.
You can’t perform that action at this time.