FIX: small diverse fixes (#35)

This commit is contained in:
Nicolás Hatcher Andrés
2024-04-14 21:50:14 +02:00
committed by GitHub
parent b3b7dea930
commit 49ef846ebd
25 changed files with 246 additions and 2749 deletions

View File

@@ -80,14 +80,8 @@ static LOCALES: Lazy<HashMap<String, Locale>> = Lazy::new(|| {
serde_json::from_str(include_str!("locales.json")).expect("Failed parsing locale")
});
pub fn get_locale(_id: &str) -> Result<&Locale, String> {
pub fn get_locale(id: &str) -> Result<&Locale, String> {
// TODO: pass the locale once we implement locales in Rust
let locale = LOCALES.get("en").ok_or("Invalid locale")?;
Ok(locale)
}
// TODO: Remove this function one we implement locales properly
pub fn get_locale_fix(id: &str) -> Result<&Locale, String> {
let locale = LOCALES.get(id).ok_or("Invalid locale")?;
Ok(locale)
}