@@ -153,9 +153,15 @@ both `--config` and `--require`.
153153
154154##### ` embed_fallback_translations ` :
155155
156- Embed fallback translations inferred from the default locale. This can be useful
157- in cases where you have multiple large translation files and don't want to load
158- the default locale together with the target locale.
156+ Embed fallback translations into each locale. This can be useful in cases where
157+ you have multiple large translation files and don't want to load the default
158+ locale together with the target locale.
159+
160+ When ` I18n.fallbacks ` is configured (e.g. via ` I18n::Backend::Fallbacks ` or
161+ Rails' ` config.i18n.fallbacks ` ), the full fallback chain is respected. For
162+ example, if ` es ` falls back to ` pt ` which falls back to ` en ` , missing ` es `
163+ translations are first filled from ` pt ` , then from ` en ` . When ` I18n.fallbacks `
164+ is not configured, translations fall back directly to ` I18n.default_locale ` .
159165
160166To use it, add the following to your configuration file:
161167
@@ -166,6 +172,18 @@ pipeline:
166172 enabled : true
167173` ` `
168174
175+ > [!NOTE]
176+ >
177+ > ` I18n.fallbacks=(*)` is weird. The most common way of using it is with
178+ > `I18n.fallbacks[:es] = [:pt, :en]` and
179+ > `I18n.fallbacks = I18n::Locale::Fallbacks(default_locale, hash_map)`. If you
180+ > assign just a hash, no error will be raised, but it's not the correct
181+ > behavior, and you'll get a hash back, rather than a `I18n::Locale::Fallbacks`
182+ > instance.
183+ >
184+ > When assigning an array, remember to pass the default locale as the last
185+ > argument, as precedence is from left to right.
186+
169187# #### `export_files`:
170188
171189By default, i18n-js will export only JSON files out of your translations. This
@@ -224,7 +242,7 @@ i18n.store({
224242 es: {
225243 "bunny rabbit adventure": "conejito conejo aventura",
226244 bye: "adios",
227- "time for bed!": "hora de acostarse!",
245+ "time for bed!": "¡ hora de acostarse!",
228246 },
229247 pt: {
230248 "bunny rabbit adventure": "a aventura da coelhinha",
0 commit comments