Merge PR #2722: i18n: add Dutch and Danish interfaces

This commit is contained in:
aiongg
2026-10-22 01:51:39 +00:00
4 changed files with 5267 additions and 4 deletions
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -52,7 +52,7 @@ pub struct LangInfo {
}
/// The registry. English first: it is the fallback and the source language.
pub static LANGUAGES: [LangInfo; 23] = [
pub static LANGUAGES: [LangInfo; 25] = [
LangInfo { code: "en", name: "English", source: "", prefer_hans: false, editing_lang: None, catalog: OnceLock::new() },
// Simplified Chinese; `zh`, `zh-CN`, `zh-SG` and `zh-Hans-*` resolve here (see `candidates`).
LangInfo {
@@ -164,7 +164,10 @@ pub static LANGUAGES: [LangInfo; 23] = [
// Swedish; sv, sv-SE, sv-FI and sv_SE.UTF-8 resolve here.
LangInfo { code: "sv", name: "Svenska", source: include_str!("sv.tsv"), prefer_hans: false, editing_lang: None, catalog: OnceLock::new() },
// Croatian; `hr`, `hr-HR` and `hr_HR.UTF-8` resolve here.
LangInfo { code: "hr", name: "Hrvatski", source: include_str!("hr.tsv"), prefer_hans: false, editing_lang: None, catalog: OnceLock::new() },
LangInfo { code: "hr", name: "Hrvatski", source: include_str!("hr.tsv"), prefer_hans: false, editing_lang: None, catalog: OnceLock::new() }, // Dutch; `nl`, `nl-NL`, `nl-BE` and `nl_NL.UTF-8` resolve here.
LangInfo { code: "nl", name: "Nederlands", source: include_str!("nl.tsv"), prefer_hans: false, editing_lang: None, catalog: OnceLock::new() },
// Danish; `da`, `da-DK` and `da_DK.UTF-8` resolve here.
LangInfo { code: "da", name: "Dansk", source: include_str!("da.tsv"), prefer_hans: false, editing_lang: None, catalog: OnceLock::new() },
];
impl LangInfo {
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -51,8 +51,8 @@ fn the_first_supported_preferred_language_wins() {
assert_eq!(first_supported(["en-US", "ja-JP"]), Some(Lang::EN));
assert_eq!(first_supported([UNSUPPORTED, "qtz"]), None);
assert_eq!(first_supported(["fr-FR", "de-DE"]), Some(lang("fr")));
assert_eq!(first_supported(["nl-NL", "de-DE"]), Some(lang("de")));
assert_eq!(first_supported(["nl-NL", UNSUPPORTED]), None);
assert_eq!(first_supported([UNSUPPORTED, "de-DE"]), Some(lang("de")));
assert_eq!(first_supported(["nl-NL", "da-DK"]), Some(lang("nl")), "nl wins over da now that both are languages");
assert_eq!(first_supported([]), None);
}