mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Rewrite it in Rust
This commit is contained in:
parent
d4bef511cb
commit
039d7cfb81
51 changed files with 4018 additions and 3208 deletions
15
crunchy-cli-core/src/utils/locale.rs
Normal file
15
crunchy-cli-core/src/utils/locale.rs
Normal 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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue