mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Refactor
This commit is contained in:
parent
90212c4ec0
commit
0a40f3c40f
30 changed files with 3651 additions and 2982 deletions
|
|
@ -13,3 +13,17 @@ pub fn system_locale() -> Locale {
|
|||
Locale::en_US
|
||||
}
|
||||
}
|
||||
|
||||
/// Check if [`Locale::Custom("all")`] is in the provided locale list and return [`Locale::all`] if
|
||||
/// so. If not, just return the provided locale list.
|
||||
pub fn all_locale_in_locales(locales: Vec<Locale>) -> Vec<Locale> {
|
||||
if locales
|
||||
.iter()
|
||||
.find(|l| l.to_string().to_lowercase().trim() == "all")
|
||||
.is_some()
|
||||
{
|
||||
Locale::all()
|
||||
} else {
|
||||
locales
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue