1 parent
bba03803b7
commit
88f76adbc2
4 files changed
+1478
-3
No files matched your search
@@ -99,6 +99,7 @@ Editable drawing code, native projects and shipped exports are collected under `
|
|||||||
| assets/locales/ja.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
| assets/locales/ja.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
||||||
| assets/locales/ko.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
| assets/locales/ko.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
||||||
| assets/locales/ru.json | Alex Pro (del000) | Russian translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
| assets/locales/ru.json | Alex Pro (del000) | Russian translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
||||||
|
| assets/locales/pt-BR.json | DuBearte | Brazilian Portuguese translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
||||||
| assets/locales/tr.json | macrulz54 | Turkish translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
| assets/locales/tr.json | macrulz54 | Turkish translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
||||||
| assets/locales/uk.json | Igor Bronovskyi (BrunIF) | Ukrainian translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
| assets/locales/uk.json | Igor Bronovskyi (BrunIF) | Ukrainian translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
||||||
| assets/locales/zh.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
| assets/locales/zh.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -36,6 +36,8 @@ static GERMAN: Catalog = Catalog::new("de", "Deutsch", include_str!(concat!(env!
|
|||||||
static FRENCH: Catalog = Catalog::new("fr", "Français", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/fr.json")));
|
static FRENCH: Catalog = Catalog::new("fr", "Français", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/fr.json")));
|
||||||
static JAPANESE: Catalog = Catalog::new("ja", "日本語", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/ja.json")));
|
static JAPANESE: Catalog = Catalog::new("ja", "日本語", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/ja.json")));
|
||||||
static KOREAN: Catalog = Catalog::new("ko", "한국어", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/ko.json")));
|
static KOREAN: Catalog = Catalog::new("ko", "한국어", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/ko.json")));
|
||||||
|
static PORTUGUESE_BR: Catalog =
|
||||||
|
Catalog::new("pt-BR", "Português (Brasil)", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/pt-BR.json")));
|
||||||
static RUSSIAN: Catalog = Catalog::new("ru", "Русский", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/ru.json")));
|
static RUSSIAN: Catalog = Catalog::new("ru", "Русский", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/ru.json")));
|
||||||
static TURKISH: Catalog = Catalog::new("tr", "Türkçe", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/tr.json")));
|
static TURKISH: Catalog = Catalog::new("tr", "Türkçe", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/tr.json")));
|
||||||
static UKRAINIAN: Catalog = Catalog::new("uk", "Українська", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/uk.json")));
|
static UKRAINIAN: Catalog = Catalog::new("uk", "Українська", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/uk.json")));
|
||||||
@@ -49,6 +51,7 @@ pub const LOCALES: &[&Catalog] = &[
|
|||||||
&FRENCH,
|
&FRENCH,
|
||||||
&JAPANESE,
|
&JAPANESE,
|
||||||
&KOREAN,
|
&KOREAN,
|
||||||
|
&PORTUGUESE_BR,
|
||||||
&RUSSIAN,
|
&RUSSIAN,
|
||||||
&TURKISH,
|
&TURKISH,
|
||||||
&UKRAINIAN,
|
&UKRAINIAN,
|
||||||
@@ -542,6 +545,17 @@ mod tests {
|
|||||||
assert_eq!(tr.label("NonExistentKey"), "NonExistentKey");
|
assert_eq!(tr.label("NonExistentKey"), "NonExistentKey");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn brazilian_portuguese_catalog_is_registered_and_translates_keys() {
|
||||||
|
let pt = Locale::for_language("pt-BR");
|
||||||
|
assert_eq!(pt.name(), "Português (Brasil)");
|
||||||
|
assert!(is_supported("pt-BR"));
|
||||||
|
assert_eq!(pt.text("ui.preferences"), "Preferências");
|
||||||
|
assert_eq!(pt.format("document.save_changes", &[("name", "My {design}")]), "Salvar as alterações em My {design}?");
|
||||||
|
assert_eq!(pt.format("dialog.selected_count", &[("count", "2")]), "↖ 2 selecionados");
|
||||||
|
assert_eq!(pt.label("NonExistentKey"), "NonExistentKey");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ukrainian_catalog_translates_keys_labels_and_browser_patterns() {
|
fn ukrainian_catalog_translates_keys_labels_and_browser_patterns() {
|
||||||
let uk = Locale::for_language("uk");
|
let uk = Locale::for_language("uk");
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# UI localization
|
# UI localization
|
||||||
|
|
||||||
SolidCraft embeds its translations and works offline. English, Japanese, German, French, Korean,
|
SolidCraft embeds its translations and works offline. English, Japanese, German, French, Korean,
|
||||||
Russian, Ukrainian, Turkish and Chinese are currently registered in `crates/ui-egui/src/i18n.rs`. Adding a language requires an
|
Brazilian Portuguese, Russian, Ukrainian, Turkish and Chinese are currently registered in `crates/ui-egui/src/i18n.rs`. Adding a language requires an
|
||||||
embedded catalog and one registration there; the preferences selector and validation use the same
|
embedded catalog and one registration there; the preferences selector and validation use the same
|
||||||
registry.
|
registry.
|
||||||
|
|
||||||
@@ -31,8 +31,8 @@ that looks untranslated. Two guards catch that in the build:
|
|||||||
|
|
||||||
- `every_complete_catalog_carries_every_english_message` — adding a key to `en.json`
|
- `every_complete_catalog_carries_every_english_message` — adding a key to `en.json`
|
||||||
without giving it to a complete catalog fails the tests. English is the source catalog,
|
without giving it to a complete catalog fails the tests. English is the source catalog,
|
||||||
Japanese and Chinese are delivered complete; German, Korean, Russian, French, Ukrainian and Turkish are
|
Japanese and Chinese are delivered complete; German, Korean, Brazilian Portuguese, Russian, French, Ukrainian and
|
||||||
partial — their gaps fall back to English and are reported by `cargo xtask i18n` without
|
Turkish are partial — their gaps fall back to English and are reported by `cargo xtask i18n` without
|
||||||
failing the build. A new label needs en, ja, zh, de and ko; Russian, French and Ukrainian may
|
failing the build. A new label needs en, ja, zh, de and ko; Russian, French and Ukrainian may
|
||||||
follow later.
|
follow later.
|
||||||
- `every_toolbar_tab_and_panel_is_in_the_english_catalog` — tabs and panels reach the UI as bare
|
- `every_toolbar_tab_and_panel_is_in_the_english_catalog` — tabs and panels reach the UI as bare
|
||||||
|
|||||||
Reference in new issue
Block a user