feat(core): add i18n.localeConfigs.translate + skip translation process if i18n/<locale> dir doesn't exist (#11304)

This commit is contained in:
Sébastien Lorber 2025-07-07 14:55:46 +02:00 committed by GitHub
parent e0524a5c84
commit 1808945c1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 1061 additions and 366 deletions

View file

@ -151,6 +151,7 @@ export default {
htmlLang: 'en-US',
calendar: 'gregory',
path: 'en',
translate: false,
},
fa: {
label: 'فارسی',
@ -158,6 +159,7 @@ export default {
htmlLang: 'fa-IR',
calendar: 'persian',
path: 'fa',
translate: true,
},
},
},
@ -172,7 +174,8 @@ export default {
- `direction`: `ltr` (default) or `rtl` (for [right-to-left languages](https://developer.mozilla.org/en-US/docs/Glossary/rtl) like Farsi, Arabic, Hebrew, etc.). Used to select the locale's CSS and HTML meta attribute.
- `htmlLang`: BCP 47 language tag to use in `<html lang="...">` (or any other DOM tag name) and in `<link ... hreflang="...">`
- `calendar`: the [calendar](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) used to calculate the date era. Note that it doesn't control the actual string displayed: `MM/DD/YYYY` and `DD/MM/YYYY` are both `gregory`. To choose the format (`DD/MM/YYYY` or `MM/DD/YYYY`), set your locale name to `en-GB` or `en-US` (`en` means `en-US`).
- `path`: Root folder that all plugin localization folders of this locale are relative to. Will be resolved against `i18n.path`. Defaults to the locale's name. Note: this has no effect on the locale's `baseUrl`—customization of base URL is a work-in-progress.
- `path`: Root folder that all plugin localization folders of this locale are relative to. Will be resolved against `i18n.path`. Defaults to the locale's name (`i18n/<locale>`). Note: this has no effect on the locale's `baseUrl`—customization of base URL is a work-in-progress.
- `translate`: Should we run the translation process for this locale? By default, it is enabled if the `i18n/<locale>` folder exists
### `future` {#future}