Local names for Chinese and Traditional Chinese (#1919)

This commit is contained in:
Kingfree 2023-08-20 18:09:16 +08:00 committed by GitHub
parent 3ab179ebd3
commit 287556bc14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -324,7 +324,7 @@ impl LocalName for EquationElem {
Lang::ARABIC => "معادلة",
Lang::BOKMÅL => "Ligning",
Lang::CHINESE if option_eq(region, "TW") => "方程式",
Lang::CHINESE => "",
Lang::CHINESE => "",
Lang::CZECH => "Rovnice",
Lang::DANISH => "Ligning",
Lang::DUTCH => "Vergelijking",

View File

@ -8,6 +8,7 @@ use syntect::parsing::{SyntaxDefinition, SyntaxSet, SyntaxSetBuilder};
use typst::diag::FileError;
use typst::eval::Bytes;
use typst::syntax::{self, LinkedNode};
use typst::util::option_eq;
use super::{
FontFamily, FontList, Hyphenate, LinebreakElem, SmartQuoteElem, TextElem, TextSize,
@ -320,11 +321,12 @@ impl Finalize for RawElem {
}
impl LocalName for RawElem {
fn local_name(&self, lang: Lang, _: Option<Region>) -> &'static str {
fn local_name(&self, lang: Lang, region: Option<Region>) -> &'static str {
match lang {
Lang::ALBANIAN => "List",
Lang::ARABIC => "قائمة",
Lang::BOKMÅL => "Utskrift",
Lang::CHINESE if option_eq(region, "TW") => "程式",
Lang::CHINESE => "代码",
Lang::CZECH => "Seznam",
Lang::DANISH => "Liste",

View File

@ -3,6 +3,7 @@ use std::path::Path;
use typst::geom::Smart;
use typst::image::{Image, ImageFormat, RasterFormat, VectorFormat};
use typst::util::option_eq;
use crate::compute::Readable;
use crate::meta::{Figurable, LocalName};
@ -231,11 +232,12 @@ impl Layout for ImageElem {
}
impl LocalName for ImageElem {
fn local_name(&self, lang: Lang, _: Option<Region>) -> &'static str {
fn local_name(&self, lang: Lang, region: Option<Region>) -> &'static str {
match lang {
Lang::ALBANIAN => "Figurë",
Lang::ARABIC => "شكل",
Lang::BOKMÅL => "Figur",
Lang::CHINESE if option_eq(region, "TW") => "",
Lang::CHINESE => "",
Lang::CZECH => "Obrázek",
Lang::DANISH => "Figur",