Language Tags
This crate provides an implementation of language tags defined by RFC5646 (BCP47).
Usage
You can easily parse new language from anything that provides a [u8]
reference:
extern crate langtag;
use LanguageTag;
Note that LanguageTag::parse
does not copy the data it is given,
but only borrows it.
You can create an owning LanguageTag
instance by using
LanguageTagBuf::parse_copy
instead.
Once parsed, you can exlore every component of the language tag using the provided functions.
Mutable language tags
When the language tags owns its buffer through Vec<u8>
,
it becomes possible to access the tag mutabily to modify it.
extern crate langtag;
use TryInto;
use LangTag;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.