Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

Merge PR #2141: i18n: add Thai (th) interface language

aionggb94393400dbe
diff --cc crates/engine/src/dates.rs
index f6e3afce0,09d7fe031..2bd912f06
--- a/crates/engine/src/dates.rs
+++ b/crates/engine/src/dates.rs
@@@ -59,7 -56,7 +59,7 @@@ const AR_DAYS: [&str; 7] = ["الأحد
/// The languages month and weekday names can be written in (Preferences ▸ Date format ▸ Language):
/// the interface languages, in the same order and with the same names.
- pub static DATE_LANGUAGES: [DateLanguage; 25] = [
-pub static DATE_LANGUAGES: [DateLanguage; 24] = [
++pub static DATE_LANGUAGES: [DateLanguage; 26] = [
DateLanguage {
code: "en",
name: "English",
@@@ -401,51 -398,15 +401,60 @@@
days: ["Chủ Nhật", "Thứ Hai", "Thứ Ba", "Thứ Tư", "Thứ Năm", "Thứ Sáu", "Thứ Bảy"],
days_short: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
},
+ DateLanguage {
+ code: "fi",
+ name: "Suomi",
+ months: [
+ "tammikuu",
+ "helmikuu",
+ "maaliskuu",
+ "huhtikuu",
+ "toukokuu",
+ "kesäkuu",
+ "heinäkuu",
+ "elokuu",
+ "syyskuu",
+ "lokakuu",
+ "marraskuu",
+ "joulukuu",
+ ],
+ // After a day number the month takes the partitive: `14. lokakuuta 2026`.
+ months_with_day: Some([
+ "tammikuuta",
+ "helmikuuta",
+ "maaliskuuta",
+ "huhtikuuta",
+ "toukokuuta",
+ "kesäkuuta",
+ "heinäkuuta",
+ "elokuuta",
+ "syyskuuta",
+ "lokakuuta",
+ "marraskuuta",
+ "joulukuuta",
+ ]),
+ months_short: ["tammi", "helmi", "maalis", "huhti", "touko", "kesä", "heinä", "elo", "syys", "loka", "marras", "joulu"],
+ days: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"],
+ days_short: ["su", "ma", "ti", "ke", "to", "pe", "la"],
+ },
+ DateLanguage {
+ code: "sq",
+ name: "Shqip",
+ months: ["janar", "shkurt", "mars", "prill", "maj", "qershor", "korrik", "gusht", "shtator", "tetor", "nëntor", "dhjetor"],
+ months_with_day: None,
+ months_short: ["jan", "shk", "mar", "pri", "maj", "qer", "korr", "gush", "sht", "tet", "nën", "dhj"],
+ days: ["e diel", "e hënë", "e martë", "e mërkurë", "e enjte", "e premte", "e shtunë"],
+ days_short: ["die", "hën", "mar", "mër", "enj", "pre", "sht"],
+ },
+ DateLanguage {
+ code: "th",
+ name: "ไทย",
+ months: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],
+ months_with_day: None,
+ months_short: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."],
+ days: ["วันอาทิตย์", "วันจันทร์", "วันอังคาร", "วันพุธ", "วันพฤหัสบดี", "วันศุกร์", "วันเสาร์"],
+ days_short: ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."],
+ },
];
/// The date language for `code` (any case), or `None` when there's none.
diff --cc crates/ui-egui/src/i18n/mod.rs
index 6017e98db,82e7e00f1..b1b828b3e
--- a/crates/ui-egui/src/i18n/mod.rs
+++ b/crates/ui-egui/src/i18n/mod.rs
@@@ -147,7 -147,7 +147,7 @@@ fn plural_sl(n: u64) -> usize
}
/// The registry. English first: it is the fallback and the source language.
- pub static LANGUAGES: [LangInfo; 25] = [
-pub static LANGUAGES: [LangInfo; 24] = [
++pub static LANGUAGES: [LangInfo; 26] = [
LangInfo { code: "en", name: "English", source: "", plural: plural_one_other, rtl: false, catalog: OnceLock::new() },
LangInfo { code: "ja", name: "日本語", source: include_str!("ja.tsv"), plural: plural_none, rtl: false, catalog: OnceLock::new() },
// Simplified Chinese; `zh`, `zh-CN`, `zh-SG` and `zh-Hans-*` locales resolve here (see `candidates`).
@@@ -210,11 -210,8 +210,13 @@@
// Vietnamese; every `vi-*` locale (`vi-VN`, `vi_VN.UTF-8`) resolves here. CLDR `vi` counts have
// one form ("other"), so `@plural` entries list a single form.
LangInfo { code: "vi", name: "Tiếng Việt", source: include_str!("vi.tsv"), plural: plural_none, rtl: false, catalog: OnceLock::new() },
+ // Finnish; every `fi-*` locale (`fi-FI`, `fi_FI.UTF-8`) resolves here. Two plural forms (one, other):
+ // the partitive singular follows any number but 1 (`1 sivu`, `2 sivua`).
+ LangInfo { code: "fi", name: "Suomi", source: include_str!("fi.tsv"), plural: plural_one_other, rtl: false, catalog: OnceLock::new() },
+ // Albanian; every `sq-*` locale (`sq-AL`, `sq_AL.UTF-8`, `sq-XK`) resolves here. One/other plural, like English.
+ LangInfo { code: "sq", name: "Shqip", source: include_str!("sq.tsv"), plural: plural_one_other, rtl: false, catalog: OnceLock::new() },
+ // Thai; every `th-*` locale (`th-TH`, `th_TH.UTF-8`) resolves here. No grammatical plural.
+ LangInfo { code: "th", name: "ไทย", source: include_str!("th.tsv"), plural: plural_none, rtl: false, catalog: OnceLock::new() },
];
impl LangInfo {