Crate lcid

source ·
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

Structs

  • A language’s identifiers and information. Lookups from numeric or named identifiers return a reference to statically defined LanguageId.

Enums