mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-30 13:27:27 -06:00
Merge PR #2722: i18n: add Dutch and Danish interfaces
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user