1 parent
19be7d27e7
commit
ff7c899840
4 files changed
+1497
-2
No files matched your search
@@ -96,6 +96,7 @@ Editable drawing code, native projects and shipped exports are collected under `
|
|||||||
| assets/locales/de.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
| assets/locales/de.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
||||||
| assets/locales/en.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
| assets/locales/en.json | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 |
|
||||||
| assets/locales/fr.json | rlartot | French translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
| assets/locales/fr.json | rlartot | French translation of the English catalog, contributed upstream | MIT OR Apache-2.0 |
|
||||||
|
| assets/locales/gl.json | Pablo López (pablopeza) | Galician translation of the English catalog, contributed upstream | 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/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 |
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -34,6 +34,7 @@ impl Catalog {
|
|||||||
static ENGLISH: Catalog = Catalog::new("en", "English", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/en.json")));
|
static ENGLISH: Catalog = Catalog::new("en", "English", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/en.json")));
|
||||||
static GERMAN: Catalog = Catalog::new("de", "Deutsch", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/de.json")));
|
static GERMAN: Catalog = Catalog::new("de", "Deutsch", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/de.json")));
|
||||||
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 GALICIAN: Catalog = Catalog::new("gl", "Galego", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/locales/gl.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 =
|
static PORTUGUESE_BR: Catalog =
|
||||||
@@ -49,6 +50,7 @@ pub const LOCALES: &[&Catalog] = &[
|
|||||||
&ENGLISH,
|
&ENGLISH,
|
||||||
&GERMAN,
|
&GERMAN,
|
||||||
&FRENCH,
|
&FRENCH,
|
||||||
|
&GALICIAN,
|
||||||
&JAPANESE,
|
&JAPANESE,
|
||||||
&KOREAN,
|
&KOREAN,
|
||||||
&PORTUGUESE_BR,
|
&PORTUGUESE_BR,
|
||||||
@@ -556,6 +558,18 @@ mod tests {
|
|||||||
assert_eq!(pt.label("NonExistentKey"), "NonExistentKey");
|
assert_eq!(pt.label("NonExistentKey"), "NonExistentKey");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn galician_catalog_is_registered_and_translates_keys() {
|
||||||
|
let gl = Locale::for_language("gl");
|
||||||
|
assert_eq!(gl.name(), "Galego");
|
||||||
|
assert!(is_supported("gl"));
|
||||||
|
assert_eq!(gl.text("ui.preferences"), "Preferencias");
|
||||||
|
assert_eq!(gl.format("document.save_changes", &[("name", "My {design}")]), "Gardar os cambios en My {design}?");
|
||||||
|
assert_eq!(gl.format("dialog.selected_count", &[("count", "2")]), "↖ 2 seleccionados");
|
||||||
|
assert_eq!(gl.label("Fillet"), "Arredondamento");
|
||||||
|
assert_eq!(gl.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,6 +1,6 @@
|
|||||||
# 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, Galician, Korean,
|
||||||
Brazilian Portuguese, 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,7 +31,7 @@ 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, Brazilian Portuguese, Russian, French, Ukrainian and
|
Japanese and Chinese are delivered complete; German, Galician, Korean, Brazilian Portuguese, Russian, French, Ukrainian and
|
||||||
Turkish are 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.
|
||||||
|
|||||||
Reference in new issue
Block a user