diff options
| author | ssotoen <68116836+ssotoen@users.noreply.github.com> | 2024-08-05 12:01:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-05 10:01:57 +0000 |
| commit | d769b21356665da50fbe4e7ef69fd20a1ef2363b (patch) | |
| tree | 9b8cedfb98b3d33fd4772b544543f07d3510b41d /crates | |
| parent | 33f13d78817dfb89134916f950323889fcc897aa (diff) | |
Add Latin translation (#4609)
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst/src/text/lang.rs | 4 | ||||
| -rw-r--r-- | crates/typst/src/text/smartquote.rs | 5 | ||||
| -rw-r--r-- | crates/typst/translations/la.txt | 7 |
3 files changed, 14 insertions, 2 deletions
diff --git a/crates/typst/src/text/lang.rs b/crates/typst/src/text/lang.rs index 39115a34..041a3bdb 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); 33] = [ +const TRANSLATIONS: [(&str, &str); 34] = [ translation!("ar"), translation!("ca"), translation!("cs"), @@ -30,6 +30,7 @@ const TRANSLATIONS: [(&str, &str); 33] = [ translation!("hu"), translation!("it"), translation!("ja"), + translation!("la"), translation!("nb"), translation!("nl"), translation!("nn"), @@ -75,6 +76,7 @@ impl Lang { pub const HUNGARIAN: Self = Self(*b"hu ", 2); pub const ITALIAN: Self = Self(*b"it ", 2); pub const JAPANESE: Self = Self(*b"ja ", 2); + pub const LATIN: Self = Self(*b"la ", 2); pub const LOWER_SORBIAN: Self = Self(*b"dsb", 3); pub const NYNORSK: Self = Self(*b"nn ", 2); pub const POLISH: Self = Self(*b"pl ", 2); diff --git a/crates/typst/src/text/smartquote.rs b/crates/typst/src/text/smartquote.rs index 797f0804..64fecb76 100644 --- a/crates/typst/src/text/smartquote.rs +++ b/crates/typst/src/text/smartquote.rs @@ -196,7 +196,7 @@ impl<'s> SmartQuotes<'s> { /// region as an all-uppercase ISO 3166-alpha2 code. /// /// Currently, the supported languages are: English, Czech, Danish, German, - /// Swiss / Liechtensteinian German, Estonian, Icelandic, Lithuanian, + /// 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. @@ -225,6 +225,9 @@ impl<'s> SmartQuotes<'s> { "fr" => ("‹\u{00A0}", "\u{00A0}›", "«\u{00A0}", "\u{00A0}»"), "fi" | "sv" if alternative => ("’", "’", "»", "»"), "bs" | "fi" | "sv" => ("’", "’", "”", "”"), + "it" if alternative => default, + "la" if alternative => ("“", "”", "«\u{202F}", "\u{202F}»"), + "it" | "la" => ("“", "”", "«", "»"), "es" if matches!(region, Some("ES") | None) => ("“", "”", "«", "»"), "hu" | "pl" | "ro" => ("’", "’", "„", "”"), "no" | "nb" | "nn" if alternative => low_high, diff --git a/crates/typst/translations/la.txt b/crates/typst/translations/la.txt new file mode 100644 index 00000000..3ec63fff --- /dev/null +++ b/crates/typst/translations/la.txt @@ -0,0 +1,7 @@ +figure = Descriptio +table = Tabula +equation = Equatio +bibliography = Conspectus librorum +heading = Caput +outline = Index capitum +raw = Exemplum |
