Skip to content

Commit

Permalink
🚧 try to use fallback locale without specified encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
vnepogodin committed Feb 11, 2024
1 parent 330016d commit e9343fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/localization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn get_available_languages() -> Result<Vec<unic_langid::LanguageIdentifier>,
pub fn check_language_valid(requested_language: &str) -> bool {
let requested_lang_id: LanguageIdentifier = requested_language
.parse()
.unwrap_or_else(|_| "en_US.UTF-8".parse().expect("failed to fallback"));
.unwrap_or_else(|_| "en_US".parse().expect("failed to fallback"));

let available_languages = get_available_languages().unwrap();
available_languages.iter().any(|x| *x == requested_lang_id)
Expand Down

0 comments on commit e9343fb

Please sign in to comment.