Skip to main content

language_of

Function language_of 

Source
pub fn language_of(tag: &str) -> String
Expand description

The language a locale names, as a language pack is named: its language subtag, lower case (de of de, de-DE, de_DE.UTF-8@euro). One pack holds a language’s catalogues whatever region, encoding or modifier a locale adds, so a choice, the pack’s directory and its package id meet at this one name. Empty when no language is named.

This is the one rule for “which language is this tag”: every reader of a language tag — the packs, the toolkits, history, desktop entries — asks here, so a language picked anywhere matches everywhere.