- Themes can supply translation files in a format like `/locales/{locale}.yml`. These files should be valid YAML, with a single top level key equal to the locale being defined. For now these can only be defined using the `discourse_theme` CLI, importing a `.tar.gz`, or from a GIT repository.
- Fallback is handled on a global level (if the locale is not defined in the theme), as well as on individual keys (if some keys are missing from the selected interface language).
- Administrators can override individual keys on a per-theme basis in the /admin/customize/themes user interface.
- Theme developers should access defined translations using the new theme prefix variables:
JavaScript: `I18n.t(themePrefix("my_translation_key"))`
Handlebars: `{{theme-i18n "my_translation_key"}}` or `{{i18n (theme-prefix "my_translation_key")}}`
- To design for backwards compatibility, theme developers can check for the presence of the `themePrefix` variable in JavaScript
- As part of this, the old `{{themeSetting.setting_name}}` syntax is deprecated in favour of `{{theme-setting "setting_name"}}`
|
||
|---|---|---|
| .. | ||
| admin | ||
| discourse | ||
| discourse-common | ||
| docs | ||
| ember-addons | ||
| locales | ||
| pretty-text | ||
| select-kit | ||
| wizard | ||
| activate-account.js.no-module.es6 | ||
| admin.js.erb | ||
| application.js | ||
| auto-redirect.js.no-module.es6 | ||
| deprecated.js | ||
| discourse-loader.js | ||
| discourse-objects.js | ||
| discourse.js.es6 | ||
| embed-application.js.no-module.es6 | ||
| ember_include.js.erb | ||
| ember_jquery.js | ||
| ember-shim.js | ||
| env.js | ||
| google-tag-manager.js.no-module.es6 | ||
| google-universal-analytics.js.no-module.es6 | ||
| main_include_admin.js | ||
| markdown-it-bundle.js | ||
| omniauth-complete.js.no-module.es6 | ||
| onpopstate-handler.js.no-module.es6 | ||
| plugin-third-party.js.erb | ||
| plugin.js.erb | ||
| polyfills.js | ||
| preload-application-data.js.no-module.es6 | ||
| preload-store.js.es6 | ||
| pretty-text-bundle.js | ||
| print-page.js | ||
| service-worker.js.erb | ||
| set-prototype-polyfill.js | ||
| template_include.js.erb | ||
| vendor.js | ||
| wizard-application.js | ||
| wizard-start.js.no-module.es6 | ||
| wizard-vendor.js | ||