Skip to content

Commit

Permalink
Merge pull request #60 from snipsco/task/portuguese-v0
Browse files Browse the repository at this point in the history
Add bindings for Portuguese - PT and BR variants.
  • Loading branch information
ClemDoum authored Feb 27, 2019
2 parents b61cee7 + db365c4 commit 14768c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ macro_rules! language_enum {
}
}

language_enum!([DE, EN, ES, FR, IT, JA, KO]);
language_enum!([DE, EN, ES, FR, IT, JA, KO, PT_PT, PT_BR]);

impl FromStr for Language {
type Err = String;
Expand All @@ -34,6 +34,8 @@ impl FromStr for Language {
"it" => Ok(Language::IT),
"ja" => Ok(Language::JA),
"ko" => Ok(Language::KO),
"pt_pt" => Ok(Language::PT_PT),
"pt_br" => Ok(Language::PT_BR),
_ => Err(format!("Unknown language {}", it)),
}
}
Expand All @@ -49,6 +51,8 @@ impl ToString for Language {
Language::IT => "it".to_string(),
Language::JA => "ja".to_string(),
Language::KO => "ko".to_string(),
Language::PT_PT => "pt_pt".to_string(),
Language::PT_BR => "pt_br".to_string(),
}
}
}
Expand Down

0 comments on commit 14768c9

Please sign in to comment.