1
0
mirror of https://github.com/lise-henry/crowbook synced 2024-11-18 04:23:51 +01:00

Merge pull request #124 from d0whc3r/patch/add_catalan

feat: add catalan language
This commit is contained in:
Lizzie Crowdagger 2024-10-05 03:42:43 +02:00 committed by GitHub
commit edfbec1081
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

10
lang/document/ca.yaml Normal file

@ -0,0 +1,10 @@
toc: Índex
cover: Portada
title: Títol
chapter: Capítol
part: Part
notes: Notes
display_all: Mostra tots els capítols
display_one: Mostra un sol capítol

@ -7,6 +7,7 @@ static ES: &str = include_str!("../../lang/document/es.yaml");
static FR: &str = include_str!("../../lang/document/fr.yaml");
static RU: &str = include_str!("../../lang/document/ru.yaml");
static DE: &str = include_str!("../../lang/document/de.yaml");
static CA: &str = include_str!("../../lang/document/ca.yaml");
/// Get the hashmap for a given language
pub fn get_hash(lang: &str) -> Hash {
@ -19,6 +20,8 @@ pub fn get_hash(lang: &str) -> Hash {
YamlLoader::load_from_str(DE).unwrap()
} else if lang.starts_with("ru") {
YamlLoader::load_from_str(RU).unwrap()
} else if lang.starts_with("ca") {
YamlLoader::load_from_str(CA).unwrap()
} else {
YamlLoader::load_from_str(EN).unwrap()
};