[−][src]Crate iso639_1
iso639-1
iso639 v1 enum and utils (for Rust)
Iso 639-1
ISO 639-1:2002, Codes for the representation of names of languages — Part 1: Alpha-2 code, is the first part of the ISO 639 series of international standards for language codes. Part 1 covers the registration of two-letter codes. There are 184 two-letter codes registered as of October 2015. The registered codes cover the world's major languages. (source https://en.wikipedia.org/wiki/ISO_639-1)
Example
extern crate iso639_1; use iso639_1::{Iso639_1, from_iso639_1, to_iso639_3}; pub fn main() { assert!(Iso639_1::Fr != Iso639_1::En); assert!(from_iso639_1("fr").unwrap() == Iso639_1::Fr); assert!(to_iso639_3("fr").unwrap() == "fra"); }
Links
github: https://github.com/AlbanMinassian/iso639
license
MIT
Structs
| Iso639v1Error |
Enums
| Iso639_1 | iso639-1 enum |
| Iso639v1ErrorKind |
Functions
| from_iso639_1 | return enum |
| to_iso639_3 | get iso639-3 string (3 chars) switch iso639-1 string (2 chars) - or error |