review(#1657): Lao is selectable and renders on the web

- Language gains lo-LA, labelled ລາວ in every catalog, so the new
  translation can be chosen.
- Two Lao keys under stale names now use the catalog's names, and the
  touchpad option added since gets its Lao label.
- The web build gets a Lao font (Noto Sans Lao, generated like Thai) and
  routes Lao and Thai drawing text to their fonts; Thai had a font but
  was never routed to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-08 11:19:59 +03:00
1 parent ca84ff9cdb
commit 1882773418
26 files changed
+43 -3

No files matched your search

+6 -1
View File
@@ -53,6 +53,8 @@ pub enum Language {
JaJp,
#[serde(rename = "ko-KR")]
KoKr,
#[serde(rename = "lo-LA")]
LoLa,
#[serde(rename = "cs-CZ")]
CsCz,
#[serde(rename = "it-IT")]
@@ -70,7 +72,7 @@ pub enum Language {
}
impl Language {
pub const ALL: [Language; 22] = [
pub const ALL: [Language; 23] = [
Language::System,
Language::EnUs,
Language::BgBg,
@@ -85,6 +87,7 @@ impl Language {
Language::ItIt,
Language::JaJp,
Language::KoKr,
Language::LoLa,
Language::PlPl,
Language::RuRu,
Language::ZhCn,
@@ -112,6 +115,7 @@ impl Language {
Language::ArSa => vec!["ar-SA".parse().expect("valid locale")],
Language::JaJp => vec!["ja-JP".parse().expect("valid locale")],
Language::KoKr => vec!["ko-KR".parse().expect("valid locale")],
Language::LoLa => vec!["lo-LA".parse().expect("valid locale")],
Language::CsCz => vec!["cs-CZ".parse().expect("valid locale")],
Language::ItIt => vec!["it-IT".parse().expect("valid locale")],
Language::FiFi => vec!["fi-FI".parse().expect("valid locale")],
@@ -139,6 +143,7 @@ impl Language {
Language::ArSa => crate::tr!("language", "arabic"),
Language::JaJp => crate::tr!("language", "japanese"),
Language::KoKr => crate::tr!("language", "korean"),
Language::LoLa => crate::tr!("language", "lao"),
Language::CsCz => crate::tr!("language", "czech"),
Language::ItIt => crate::tr!("language", "italian"),
Language::FiFi => crate::tr!("language", "finnish"),
+9
View File
@@ -31,6 +31,7 @@ pub enum Script {
Arabic,
Hebrew,
Thai,
Lao,
Devanagari,
Chinese,
TraditionalChinese,
@@ -49,6 +50,7 @@ impl Script {
Script::Arabic => "fonts/arabic.ttf",
Script::Hebrew => "fonts/hebrew.ttf",
Script::Thai => "fonts/thai.ttf",
Script::Lao => "fonts/lao.ttf",
Script::Devanagari => "fonts/devanagari.ttf",
Script::Chinese => "fonts/chinese.ttf",
Script::TraditionalChinese => "fonts/traditional_chinese.ttf",
@@ -69,6 +71,7 @@ impl Script {
| Script::Arabic
| Script::Hebrew
| Script::Thai
| Script::Lao
| Script::Devanagari => "Noto Sans",
}
}
@@ -85,6 +88,7 @@ impl Script {
8 => Script::Japanese,
9 => Script::Korean,
10 => Script::TraditionalChinese,
11 => Script::Lao,
_ => Script::Latin,
}
}
@@ -103,6 +107,7 @@ impl Script {
Script::Japanese => 8,
Script::Korean => 9,
Script::TraditionalChinese => 10,
Script::Lao => 11,
}
}
}
@@ -143,6 +148,7 @@ pub fn scripts_for_language_tag(language: &str) -> Vec<Script> {
"ko" => Some(Script::Korean),
"ru" | "uk" | "bg" | "sr" => Some(Script::Cyrillic),
"th" => Some(Script::Thai),
"lo" => Some(Script::Lao),
"zh" => Some(Script::Chinese),
_ => None,
}
@@ -176,6 +182,7 @@ pub fn requires_shaping(text: &str) -> bool {
| 0x08A0..=0x08FF
| 0x0900..=0x097F
| 0x0E00..=0x0E7F
| 0x0E80..=0x0EFF
| 0xA8E0..=0xA8FF
| 0xFB1D..=0xFB4F
| 0xFB50..=0xFDFF
@@ -224,6 +231,8 @@ pub fn script_of(ch: char) -> Option<Script> {
Script::Arabic
}
0x0900..=0x097F | 0xA8E0..=0xA8FF => Script::Devanagari,
0x0E00..=0x0E7F => Script::Thai,
0x0E80..=0x0EFF => Script::Lao,
// Hangul → always Korean; kana → always Japanese.
0x1100..=0x11FF | 0x3130..=0x318F | 0xAC00..=0xD7A3 => Script::Korean,
0x3040..=0x30FF | 0x31F0..=0x31FF => Script::Japanese,