Rewrite it in Rust

This commit is contained in:
ByteDream 2022-10-20 18:52:08 +02:00
parent d4bef511cb
commit 039d7cfb81
51 changed files with 4018 additions and 3208 deletions

View file

@ -0,0 +1,15 @@
use crunchyroll_rs::Locale;
/// Return the locale of the system.
pub fn system_locale() -> Locale {
if let Some(system_locale) = sys_locale::get_locale() {
let locale = Locale::from(system_locale);
if let Locale::Custom(_) = locale {
Locale::en_US
} else {
locale
}
} else {
Locale::en_US
}
}