forked from hack-ink/AiR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display local language name in the selector
- Loading branch information
1 parent
7eb48d3
commit 57b9c53
Showing
8 changed files
with
62 additions
and
1,037 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// crates.io | ||
use language::Language; | ||
use serde::{Deserialize, Deserializer}; | ||
|
||
pub fn translation_a<'de, D>(d: D) -> Result<Language, D::Error> | ||
where | ||
D: Deserializer<'de>, | ||
{ | ||
Ok(Language::deserialize(d).unwrap_or(Language::ZhCn)) | ||
} | ||
|
||
pub fn translation_b<'de, D>(d: D) -> Result<Language, D::Error> | ||
where | ||
D: Deserializer<'de>, | ||
{ | ||
Ok(Language::deserialize(d).unwrap_or(Language::EnGb)) | ||
} |
Oops, something went wrong.