diff --git a/crates/typst/src/text/lang.rs b/crates/typst/src/text/lang.rs index e439533df..6c9c886ab 100644 --- a/crates/typst/src/text/lang.rs +++ b/crates/typst/src/text/lang.rs @@ -14,7 +14,7 @@ macro_rules! translation { }; } -const TRANSLATIONS: [(&str, &str); 35] = [ +const TRANSLATIONS: [(&str, &str); 36] = [ translation!("ar"), translation!("ca"), translation!("cs"), @@ -27,6 +27,7 @@ const TRANSLATIONS: [(&str, &str); 35] = [ translation!("fr"), translation!("gl"), translation!("gr"), + translation!("he"), translation!("hu"), translation!("is"), translation!("it"), @@ -74,6 +75,7 @@ impl Lang { pub const GALICIAN: Self = Self(*b"gl ", 2); pub const GERMAN: Self = Self(*b"de ", 2); pub const GREEK: Self = Self(*b"gr ", 2); + pub const HEBREW: Self = Self(*b"he ", 2); pub const HUNGARIAN: Self = Self(*b"hu ", 2); pub const ICELANDIC: Self = Self(*b"is ", 2); pub const ITALIAN: Self = Self(*b"it ", 2); diff --git a/crates/typst/src/text/smartquote.rs b/crates/typst/src/text/smartquote.rs index 02c93fd6b..0bcccf41c 100644 --- a/crates/typst/src/text/smartquote.rs +++ b/crates/typst/src/text/smartquote.rs @@ -208,7 +208,7 @@ impl<'s> SmartQuotes<'s> { /// Swiss / Liechtensteinian German, Estonian, Icelandic, Italian, Latin, /// Lithuanian, Latvian, Slovak, Slovenian, Spanish, Bosnian, Finnish, /// Swedish, French, Hungarian, Polish, Romanian, Japanese, Traditional - /// Chinese, Russian, and Norwegian. + /// Chinese, Russian, Norwegian, and Hebrew. /// /// For unknown languages, the English quotes are used as fallback. pub fn get( @@ -242,6 +242,7 @@ impl<'s> SmartQuotes<'s> { "no" | "nb" | "nn" if alternative => low_high, "ru" | "no" | "nb" | "nn" | "ua" => ("’", "’", "«", "»"), "gr" => ("‘", "’", "«", "»"), + "he" => ("’", "’", "”", "”"), _ if lang.dir() == Dir::RTL => ("’", "‘", "”", "“"), _ => default, }; diff --git a/crates/typst/translations/he.txt b/crates/typst/translations/he.txt new file mode 100644 index 000000000..7c3705a44 --- /dev/null +++ b/crates/typst/translations/he.txt @@ -0,0 +1,7 @@ +figure = איור +table = טבלה +equation = משוואה +bibliography = רשימת מקורות +heading = חלק +outline = תוכן עניינים +raw = קטע מקור diff --git a/tests/ref/issue-4476-rtl-title-ending-in-ltr-text.png b/tests/ref/issue-4476-rtl-title-ending-in-ltr-text.png index 09506966e..f3fda12ed 100644 Binary files a/tests/ref/issue-4476-rtl-title-ending-in-ltr-text.png and b/tests/ref/issue-4476-rtl-title-ending-in-ltr-text.png differ diff --git a/tests/ref/smartquote.png b/tests/ref/smartquote.png index e297c6a0b..4adf31851 100644 Binary files a/tests/ref/smartquote.png and b/tests/ref/smartquote.png differ diff --git a/tests/suite/text/smartquote.typ b/tests/suite/text/smartquote.typ index a69ad25c9..04a820361 100644 --- a/tests/suite/text/smartquote.typ +++ b/tests/suite/text/smartquote.typ @@ -28,7 +28,7 @@ "Το άλογο δεν τρώει αγγουροσαλάτα" ήταν η πρώτη πρόταση που ειπώθηκε στο 'τηλέφωνο'. #set text(lang: "he") -"הסוס לא אוכל סלט מלפפונים" היה המשפט ההראשון שנאמר ב 'טלפון'. +"הסוס לא אוכל סלט מלפפונים" היה המשפט ההראשון שנאמר ב'טלפון'. #set text(lang: "ro") "Calul nu mănâncă salată de castraveți" a fost prima propoziție rostită vreodată la 'telefon'.