UNPKG

3.25 kBJavaScriptView Raw
1/*jshint node:true*/
2
3module.exports = function(/* environment */) {
4 return {
5 /**
6 * The locales that the application needs to support.
7 *
8 * NOTE: this is optional and is automatically set *if* you store translations
9 * within the `inputPath` defined below.
10 *
11 * If you side load translations, you must then explicitly
12 * list out the locales. i.e: ['en-us', 'en-gb', 'fr-fr']
13 *
14 * @property locales
15 * @type {Array?}
16 * @default "null"
17 */
18 locales: null,
19
20 /**
21 * Merges the fallback locale's translations into all other locales as a
22 * build-time fallback strategy.
23 *
24 * NOTE: a side effect of this option could result in missing translation warnings to be masked.
25 *
26 * @property fallbackLocale
27 * @type {String?}
28 * @default "null"
29 */
30 fallbackLocale: null,
31
32 /**
33 * Path where translations are kept. This is relative to the project root.
34 * For example, if your translations are an npm dependency, set this to:
35 *`'./node_modules/path/to/translations'`
36 *
37 * @property inputPath
38 * @type {String}
39 * @default "'translations'"
40 */
41 inputPath: 'translations',
42
43 /**
44 * Automatically inject the Intl.JS polyfill into index.html
45 *
46 * @property autoPolyfill
47 * @type {Boolean}
48 * @default "false"
49 */
50 autoPolyfill: false,
51
52 /**
53 * Prevents the polyfill from being bundled in the asset folder of the build
54 *
55 * @property disablePolyfill
56 * @type {Boolean}
57 * @default "false"
58 */
59 disablePolyfill: false,
60
61 /**
62 * Prevents the translations from being bundled with the application code.
63 * This enables asynchronously loading the translations for the active locale
64 * by fetching them from the asset folder of the build.
65 *
66 * See: https://ember-intl.github.io/ember-intl/docs/guide/asynchronously-loading-translations
67 *
68 * @property publicOnly
69 * @type {Boolean}
70 * @default "false"
71 */
72 publicOnly: false,
73
74 /**
75 * Cause a build error if ICU argument mismatches are detected.
76 *
77 * @property errorOnNamedArgumentMismatch
78 * @type {Boolean}
79 * @default "false"
80 */
81 errorOnNamedArgumentMismatch: false,
82
83 /**
84 * Cause a build error if missing translations are detected.
85 *
86 * See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#throwing-a-build-error-on-missing-required-translation
87 *
88 * @property errorOnMissingTranslations
89 * @type {Boolean}
90 * @default "false"
91 */
92 errorOnMissingTranslations: false,
93
94 /**
95 * removes empty translations from the build output.
96 *
97 * @property stripEmptyTranslations
98 * @type {Boolean}
99 * @default false
100 */
101 stripEmptyTranslations: false,
102
103 /**
104 * Filter missing translations to ignore expected missing translations.
105 *
106 * See https://ember-intl.github.io/ember-intl/docs/guide/missing-translations#requiring-translations
107 *
108 * @property requiresTranslation
109 * @type {Function}
110 * @default "function(key,locale){return true}"
111 */
112 requiresTranslation(/* key, locale */) {
113 return true;
114 }
115 };
116};