-#[derive(Clone, Debug, Deserialize, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub(crate) struct LanguageTag {
- pub(crate) identifier: String,
- pub(crate) name: String,
-}
-
-impl LanguageTag {
- pub(crate) fn new(lang: Language) -> Option<LanguageTag> {
- // undetermined
- if lang.code == "und" {
- None
- } else {
- Some(LanguageTag {
- identifier: lang.code,
- name: lang.name,
- })
- }
- }
-}