mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 14:51:13 -03:00
If a language is specified using only the language code, without a region identifier, assume that the user prefers translations from any variant of the language over the next fallback option. For example, when a user sets `LANGUAGE=zh:pt`, assume that the user prefers both `zh_CN` and `zh_TW` over the next fallback option. The precedence of the different variants of a language will be arbitrary. In this example, with the current set of relevant available catalogs (`pt_BR`, `zh_CN`, `zh_TW`), the effective precedence will be either `zh_CN:zh_TW:pt_BR` or `zh_TW:zh_CN:pt_BR`. Users who want more control over the order can specify variants to get the results they want. For example: - `LANGUAGE=zh_TW:zh:pt` will result in `zh_TW:zh_CN:pt_BR`. - `LANGUAGE=zh_CN:pt:zh` will result in `zh_CN:pt_BR:zh_TW`. - `LANGUAGE=zh_CN:pt` will result in `zh_CN:pt_BR`. English is always used as the last fallback. This approach (like the previous approach) differs from GNU gettext semantics, which map region-less language codes to on specific "default" variant of the language, without specifying how this default is chosen. We want to avoid making such choices and believe it is better to utilize translations from all language variants we have available when users do not explicitly specify their preferred variant. This way, users have an easier time discovering localization availability, and can be more explicit in their preferences if they don't like the defaults. If there are conflicts with gettext semantics, users can also set locale variables without exporting them, so fish uses different values than its child processes. Closes #12011