Provide support for portuguese language (#525)

This commit is contained in:
Mateus Felipe C. C. Pinto 2023-04-03 07:59:13 -03:00 committed by GitHub
parent 37eededc9d
commit 2dbbeaeb60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 7 deletions

View File

@ -283,10 +283,11 @@ impl<T: Into<Value>> From<Celled<T>> for Value {
impl LocalName for TableElem {
fn local_name(&self, lang: Lang) -> &'static str {
match lang {
Lang::FRENCH => "Tableau",
Lang::CHINESE => "",
Lang::FRENCH => "Tableau",
Lang::GERMAN => "Tabelle",
Lang::ITALIAN => "Tabella",
Lang::PORTUGUESE => "Tabela",
Lang::RUSSIAN => "Таблица",
Lang::ENGLISH | _ => "Table",
}

View File

@ -267,10 +267,11 @@ impl Count for EquationElem {
impl LocalName for EquationElem {
fn local_name(&self, lang: Lang) -> &'static str {
match lang {
Lang::FRENCH => "Équation",
Lang::CHINESE => "等式",
Lang::FRENCH => "Équation",
Lang::GERMAN => "Gleichung",
Lang::ITALIAN => "Equazione",
Lang::PORTUGUESE => "Equação",
Lang::RUSSIAN => "Уравнение",
Lang::ENGLISH | _ => "Equation",
}

View File

@ -203,6 +203,7 @@ impl LocalName for BibliographyElem {
Lang::GERMAN | Lang::FRENCH => "Bibliographie",
Lang::CHINESE => "参考文献",
Lang::ITALIAN => "Bibliografia",
Lang::PORTUGUESE => "Bibliografia",
Lang::RUSSIAN => "Библиография",
Lang::ENGLISH | _ => "Bibliography",
}

View File

@ -89,6 +89,7 @@ impl LocalName for FigureElem {
Lang::CHINESE => "",
Lang::GERMAN => "Abbildung",
Lang::ITALIAN => "Figura",
Lang::PORTUGUESE => "Figura",
Lang::RUSSIAN => "Рисунок",
Lang::ENGLISH | Lang::FRENCH | _ => "Figure",
}

View File

@ -140,10 +140,11 @@ cast_from_value! {
impl LocalName for HeadingElem {
fn local_name(&self, lang: Lang) -> &'static str {
match lang {
Lang::FRENCH => "Chapitre",
Lang::CHINESE => "小节",
Lang::FRENCH => "Chapitre",
Lang::GERMAN => "Abschnitt",
Lang::ITALIAN => "Sezione",
Lang::PORTUGUESE => "Seção",
Lang::RUSSIAN => "Раздел",
Lang::ENGLISH | _ => "Section",
}

View File

@ -179,10 +179,11 @@ impl Show for OutlineElem {
impl LocalName for OutlineElem {
fn local_name(&self, lang: Lang) -> &'static str {
match lang {
Lang::FRENCH => "Table des matières",
Lang::CHINESE => "目录",
Lang::FRENCH => "Table des matières",
Lang::GERMAN => "Inhaltsverzeichnis",
Lang::ITALIAN => "Indice",
Lang::PORTUGUESE => "Sumário",
Lang::RUSSIAN => "Содержание",
Lang::ENGLISH | _ => "Contents",
}

View File

@ -517,10 +517,11 @@ pub struct Lang([u8; 3], u8);
impl Lang {
pub const CHINESE: Self = Self(*b"zh ", 2);
pub const ENGLISH: Self = Self(*b"en ", 2);
pub const GERMAN: Self = Self(*b"de ", 2);
pub const RUSSIAN: Self = Self(*b"ru ", 2);
pub const ITALIAN: Self = Self(*b"it ", 2);
pub const FRENCH: Self = Self(*b"fr ", 2);
pub const GERMAN: Self = Self(*b"de ", 2);
pub const ITALIAN: Self = Self(*b"it ", 2);
pub const PORTUGUESE: Self = Self(*b"pt ", 2);
pub const RUSSIAN: Self = Self(*b"ru ", 2);
/// Return the language code as an all lowercase string slice.
pub fn as_str(&self) -> &str {