Skip to main content

chain

Function chain 

Source
pub fn chain(locale: &str, available: &[&str]) -> Vec<String>
Expand description

The locales a lookup tries, most specific first, ending with English: zh-Hant-TW gives zh-Hant-TW, zh-Hant, zh, en. When the language has no catalogue of its own but a regional one is available (pt-BR for pt-PT), that one is tried after the language. The pseudo-locale reads English.

use egui_pop_i18n::locale::chain;

assert_eq!(chain("fr-CA", &[]), ["fr-CA", "fr", "en"]);
assert_eq!(chain("pt-PT", &["pt-BR"]), ["pt-PT", "pt", "pt-BR", "en"]);