diff options
| author | MALO <57839069+MDLC01@users.noreply.github.com> | 2023-11-10 17:17:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-10 17:17:39 +0100 |
| commit | 13f1a4386faac13b21722b744843152a88791e50 (patch) | |
| tree | 30301f0c69dbbaff24914acfb567bdea7d0e54fc /crates/typst-library/src | |
| parent | 010084e2d6d4c766bac9cc751ee6940cd3278695 (diff) | |
Improve French and Chinese localization for figures (#2542)
Diffstat (limited to 'crates/typst-library/src')
| -rw-r--r-- | crates/typst-library/src/meta/figure.rs | 17 | ||||
| -rw-r--r-- | crates/typst-library/src/visualize/image.rs | 2 |
2 files changed, 5 insertions, 14 deletions
diff --git a/crates/typst-library/src/meta/figure.rs b/crates/typst-library/src/meta/figure.rs index bfcc9b44..362f869e 100644 --- a/crates/typst-library/src/meta/figure.rs +++ b/crates/typst-library/src/meta/figure.rs @@ -1,6 +1,5 @@ use std::borrow::Cow; use std::str::FromStr; -use typst::util::option_eq; use super::{Count, Counter, CounterKey, CounterUpdate, Numbering, NumberingPattern}; use crate::layout::{BlockElem, PlaceElem, VElem}; @@ -499,20 +498,12 @@ pub struct FigureCaption { impl FigureCaption { /// Gets the default separator in the given language and (optionally) /// region. - fn local_separator(lang: Lang, region: Option<Region>) -> &'static str { + fn local_separator(lang: Lang, _: Option<Region>) -> &'static str { match lang { - Lang::CHINESE => ":", - Lang::FRENCH if option_eq(region, "CH") => "\u{202f}: ", - Lang::FRENCH => "\u{a0}: ", + Lang::CHINESE => "\u{2003}", + Lang::FRENCH => ".\u{a0}– ", Lang::RUSSIAN => ". ", - Lang::DANISH - | Lang::DUTCH - | Lang::ENGLISH - | Lang::GERMAN - | Lang::ITALIAN - | Lang::SPANISH - | Lang::SWEDISH - | _ => ": ", + Lang::ENGLISH | _ => ": ", } } diff --git a/crates/typst-library/src/visualize/image.rs b/crates/typst-library/src/visualize/image.rs index 7f0b8289..b877c472 100644 --- a/crates/typst-library/src/visualize/image.rs +++ b/crates/typst-library/src/visualize/image.rs @@ -234,7 +234,7 @@ impl LocalName for ImageElem { Lang::DUTCH => "Figuur", Lang::FILIPINO => "Pigura", Lang::FINNISH => "Kuva", - Lang::FRENCH => "Figure", + Lang::FRENCH => "Fig.", Lang::GERMAN => "Abbildung", Lang::HUNGARIAN => "Ábra", Lang::ITALIAN => "Figura", |
