Organizing translations
Translations are stored in the translations folder, either as a *.json or *.{yaml,yml} file.
my-app
├── app
└── translationsmy-v1-addon
├── addon
└── translationsmy-v2-addon
├── src
└── translationsAs the project grows, you will find the need to organize your translations. Here are a couple of ways to do so.
Nested folders
You may create subdirectories to organize your translations.
my-app
├── app
└── translations
├── components
│ └── hello
│ ├── de-de.yaml
│ └── en-us.yaml
└── routes
└── application
├── de-de.yaml
└── en-us.yamlEach translation file should have a "namespace," an identifier that helps you localize the translations to that file.
yaml
components.hello:
message: Hallo, {name}!yaml
routes.application:
title: Willkommen bei ember-intlNamespaced keys
In ember-intl.config.mjs, set buildOptions.wrapTranslationsWithNamespace to true to derive the namespace from folder names.
yaml
message: Hallo, {name}!yaml
title: Willkommen bei ember-intlNOTE
Spaces in a folder name are converted to underscores.