You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nick Zana b08078e27d
Add usage examples to README
5 months ago
iso639-databases@3ee25da5c3 Inital Commit 1 year ago
src Fix breaking API change of IsoCompat scope 7 months ago
.gitignore Inital Commit 1 year ago
.gitmodules Inital Commit 1 year ago
Cargo.toml Fix breaking API change of IsoCompat scope 7 months ago
LICENSE Create LICENSE 1 year ago
README.md Add usage examples to README 5 months ago
build.rs Replace generate match statements with phf::Map 8 months ago

README.md

iso639_enum

An ISO639 Language Code implementation developed for the rms-metadata library.

Usage:

assert_eq!(Language::Eng.name(), "English");
assert_eq!(Language::Eng.iso639_3(), "eng");
assert_eq!(Language::Eng.iso639_1(), Some("en"));
assert_eq!(Language::Eng.autonym(), Some("English"));


assert_eq!(Language::from_name("English").ok(), Some(Language::Eng));
assert_eq!(Language::from_iso639_3("eng").ok(), Some(Language::Eng));
assert_eq!(Language::from_iso639_1("en").ok(), Some(Language::Eng));
assert_eq!(Language::from_autonym("English").ok(), Some(Language::Eng));

Data

The data is sourced from [https://github.com/bbqsrc/iso639-databases].