mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Local names for Chinese and Traditional Chinese (#1919)
This commit is contained in:
parent
3ab179ebd3
commit
287556bc14
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user