Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/gui/examples/screenshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use i_slint_backend_testing::ElementHandle;
use slint::{ComponentHandle, LogicalSize, Timer};

/// The bundled languages, by the codes the Settings window saves.
const LANGUAGES: [&str; 4] = ["en", "es", "hi", "zh_CN"];
const LANGUAGES: [&str; 6] = ["en", "es", "hi", "ru", "tr", "zh_CN"];

/// The `min-width` and `min-height` in `ui/main-window.slint` and
/// `ui/settings-window.slint`.
Expand Down
4 changes: 3 additions & 1 deletion crates/gui/src/locale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// The folders under `translations/`. `every_translation_folder_is_listed`
/// below checks that they match.
pub const LANGUAGES: &[&str] = &["es", "hi", "tr", "zh_CN"];
pub const LANGUAGES: &[&str] = &["es", "hi", "ru", "tr", "zh_CN"];

/// Settings > Language lists these, each in its own language and script so
/// a reader finds theirs whatever the app is showing. `en` is the source
Expand All @@ -16,6 +16,7 @@ pub const NAMES: &[(&str, &str)] = &[
("en", "English"),
("es", "Español"),
("hi", "हिन्दी"),
("ru", "Русский"),
("tr", "Türkçe"),
("zh_CN", "简体中文"),
];
Expand Down Expand Up @@ -222,6 +223,7 @@ mod tests {
assert_eq!(first(&["en-US", "zh-CN"]), "");
assert_eq!(first(&["hi-IN"]), "hi");
assert_eq!(first(&["es-MX"]), "es");
assert_eq!(first(&["ru-RU"]), "ru");
assert_eq!(first(&["tr-TR"]), "tr");
assert_eq!(first(&["fr-FR"]), "");
assert_eq!(first(&[]), "");
Expand Down
5 changes: 3 additions & 2 deletions crates/gui/tests/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ fn choosing_a_language_switches_the_window_and_is_saved() {
"English",
"Español",
"हिन्दी",
"Русский",
"Türkçe",
"简体中文"
]
Expand All @@ -98,7 +99,7 @@ fn choosing_a_language_switches_the_window_and_is_saved() {
assert!(ui.get_formats().contains("Supported formats"));
assert!(ui.get_summary().contains("1 entry"), "{}", ui.get_summary());

choose(&settings, 5);
choose(&settings, 6);
assert!(
ui.get_formats().contains("支持的格式"),
"{}",
Expand All @@ -115,7 +116,7 @@ fn choosing_a_language_switches_the_window_and_is_saved() {
"{}",
ui.get_shell_menu_label()
);
assert_eq!(settings.get_language_index(), 5);
assert_eq!(settings.get_language_index(), 6);
// The first entry is worded again; the names stay in their own scripts
// whatever is showing.
assert_eq!(
Expand Down
1 change: 1 addition & 0 deletions crates/gui/translations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The desktop app is translated with Slint's `@tr()` and gettext catalogs. Each la
|---|---|
| Español | `es` |
| हिन्दी (Hindi) | `hi` |
| Русский (Russian) | `ru` |
| Türkçe (Turkish) | `tr` |
| 简体中文 (Simplified Chinese) | `zh_CN` |

Expand Down
Loading
Loading