/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththisfile,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
use nsstring::nsACString; pubuse unic_langid::{subtags, CharacterDirection, LanguageIdentifier, LanguageIdentifierError};
pubfn new_langid_for_mozilla(
name: &nsACString,
) -> Result<LanguageIdentifier, LanguageIdentifierError> { if name.eq_ignore_ascii_case(b"ja-jp-mac") { "ja-JP-macos".parse()
} else { // Cut out any `.FOO` like `en-US.POSIX`. letmut name: &[u8] = name.as_ref(); iflet Some(ptr) = name.iter().position(|b| b == &b'.') {
name = &name[..ptr];
}
LanguageIdentifier::from_bytes(name)
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.