Fix smartquotes for Swiss French (#4992)

This commit is contained in:
Jeremie Knuesel 2024-09-26 11:09:32 +02:00 committed by GitHub
parent 8d38bd4066
commit 4827f28a94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View File

@ -207,8 +207,8 @@ impl<'s> SmartQuotes<'s> {
/// Currently, the supported languages are: English, Czech, Danish, German,
/// Swiss / Liechtensteinian German, Estonian, Icelandic, Italian, Latin,
/// Lithuanian, Latvian, Slovak, Slovenian, Spanish, Bosnian, Finnish,
/// Swedish, French, Hungarian, Polish, Romanian, Japanese, Traditional
/// Chinese, Russian, Norwegian, and Hebrew.
/// Swedish, French, Swiss French, Hungarian, Polish, Romanian, Japanese,
/// Traditional Chinese, Russian, Norwegian, and Hebrew.
///
/// For unknown languages, the English quotes are used as fallback.
pub fn get(
@ -227,6 +227,10 @@ impl<'s> SmartQuotes<'s> {
false => ("", "", "«", "»"),
true => low_high,
},
"fr" if matches!(region, Some("CH")) => match alternative {
false => ("\u{202F}", "\u{202F}", "«\u{202F}", "\u{202F}»"),
true => default,
},
"cs" | "da" | "de" | "sk" | "sl" if alternative => ("", "", "»", "«"),
"cs" | "de" | "et" | "is" | "lt" | "lv" | "sk" | "sl" => low_high,
"da" => ("", "", "", ""),

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -22,6 +22,10 @@
#set text(lang: "fr")
"Le cheval ne mange pas de salade de concombres" est la première phrase jamais prononcée au 'téléphone'.
--- smartquote-fr-ch ---
#set text(lang: "fr", region: "CH")
"Le cheval ne mange pas de salade de concombres" est la première phrase jamais prononcée au 'téléphone'.
--- smartquote-fi ---
#set text(lang: "fi")
"Hevonen ei syö kurkkusalaattia" oli ensimmäinen koskaan 'puhelimessa' lausuttu lause.