mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
update translating readme
This commit is contained in:
@ -131,14 +131,18 @@ which should be filled in accordingly. You can then add your translations
|
||||
within the newly created translation file.
|
||||
|
||||
Afterwards, you need to update the list of known locales within Ghostty's
|
||||
build system. To do so, open `src/build/GhosttyI18n.zig` and find the list
|
||||
of locales under the `locale` variable, then append the full locale name
|
||||
build system. To do so, open `src/os/i81n.zig` and find the list
|
||||
of locales under the `locales` variable, then add the full locale name
|
||||
into the list.
|
||||
|
||||
The order matters, so make sure to place your locale in the correct position.
|
||||
Read the comment above the variable for more details on the order. If you're
|
||||
unsure, place it at the end of the list.
|
||||
|
||||
```zig
|
||||
const locales = [_][]const u8{
|
||||
"zh_CN.UTF-8",
|
||||
// <- Add your locale here
|
||||
// <- Add your locale here (probably)
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -11,6 +11,17 @@ const log = std.log.scoped(.i18n);
|
||||
/// a language code available), the first match is used. For example, if
|
||||
/// we know the user requested `zh` but has no region code, then we'd pick
|
||||
/// the first locale that matches `zh`.
|
||||
///
|
||||
/// For ordering, we prefer:
|
||||
///
|
||||
/// 1. The most common locales first, since there are places in the code
|
||||
/// where we do linear searches for a locale and we want to minimize
|
||||
/// the number of iterations for the common case.
|
||||
///
|
||||
/// 2. Alphabetical for otherwise equally common locales.
|
||||
///
|
||||
/// 3. Most preferred locale for a language without a country code.
|
||||
///
|
||||
pub const locales = [_][:0]const u8{
|
||||
"zh_CN.UTF-8",
|
||||
};
|
||||
|
Reference in New Issue
Block a user