Expand description
This crate provides language information and lookups from Microsoft’s numeric
language code identifiers (LCIDs) or language names (IETF language tags,
BCP 47), similar to - but more limited than - the
System.Globalization.CultureInfo class in .NET. The lookup follows the
MS-LCID “Windows Language Code Identifier Reference” specification.
Sort IDs are not supported yet.
§Examples
use lcid::LanguageId;
use std::convert::TryInto;
let lang: &LanguageId = 1033.try_into().unwrap();
assert_eq!(lang.name, "en-US");
let lang: &LanguageId = "en-US".try_into().unwrap();
assert_eq!(lang.lcid, 1033);Modules§
- constants
- Contains all defined
LanguageIdreturned by the lookups.
Structs§
- Language
Id - A language’s identifiers and information. Lookups from numeric or named
identifiers return a reference to statically defined
LanguageId.
Enums§
- Ansi
Code Page - A known ANSI code page. Some languages can be encoded using one of these
code pages. This enum has a
u32representation, and so can be converted to the numeric code page value if needed. - Lcid
Lookup Error - Errors when looking up a
LanguageIdfrom a numeric (u32) LCID viaTryFromorTryInto. - Name
Lookup Error - Errors when looking up a
LanguageIdfrom a named identifier viaTryFromorTryInto.