Skip to content

Commit

Permalink
add more settings in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don committed Dec 22, 2024
1 parent 0a77026 commit 8f0ef89
Show file tree
Hide file tree
Showing 21 changed files with 465 additions and 142 deletions.
104 changes: 52 additions & 52 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ entity = { path = "../entity" }
global-hotkey = "0"
sea-orm = { version = "1" }
serde = { version = "1" }
serde_json = { version = "1" }
serde_json = { version = "1" }
24 changes: 21 additions & 3 deletions src-tauri/common/src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ pub fn get_system_language() -> Language {
if let Ok(lang) = std::env::var("LANG") {
let lang = lang.to_lowercase();
match &lang[..2] {
s if s == Language::German.to_string() => Language::German,
s if s == Language::Mandarin.to_string() => Language::Mandarin,
s if s == Language::Hindi.to_string() => Language::Hindi,
s if s == Language::Spanish.to_string() => Language::Spanish,
s if s == Language::French.to_string() => Language::French,
s if s == Language::Arabic.to_string() => Language::Arabic,
s if s == Language::Bengali.to_string() => Language::Bengali,
s if s == Language::Portuguese.to_string() => Language::Portuguese,
s if s == Language::Russian.to_string() => Language::Russian,
s if s == Language::Urdu.to_string() => Language::Urdu,
_ => Language::English,
}
} else {
Expand All @@ -24,9 +30,15 @@ pub fn get_system_language() -> Language {
if let Ok(lang) = std::str::from_utf8(&result.stdout) {
let lang = lang.trim().to_lowercase();
match lang.as_str() {
s if s == Language::German.to_string() => Language::German,
s if s == Language::Mandarin.to_string() => Language::Mandarin,
s if s == Language::Hindi.to_string() => Language::Hindi,
s if s == Language::Spanish.to_string() => Language::Spanish,
s if s == Language::French.to_string() => Language::French,
s if s == Language::Arabic.to_string() => Language::Arabic,
s if s == Language::Bengali.to_string() => Language::Bengali,
s if s == Language::Portuguese.to_string() => Language::Portuguese,
s if s == Language::Russian.to_string() => Language::Russian,
s if s == Language::Urdu.to_string() => Language::Urdu,
_ => Language::English,
}
} else {
Expand All @@ -46,9 +58,15 @@ pub fn get_system_language() -> Language {
if let Ok(lang) = std::str::from_utf8(&result.stdout) {
let lang = lang.to_lowercase();
match &lang[..2] {
s if s == Language::German.to_string() => Language::German,
s if s == Language::Mandarin.to_string() => Language::Mandarin,
s if s == Language::Hindi.to_string() => Language::Hindi,
s if s == Language::Spanish.to_string() => Language::Spanish,
s if s == Language::French.to_string() => Language::French,
s if s == Language::Arabic.to_string() => Language::Arabic,
s if s == Language::Bengali.to_string() => Language::Bengali,
s if s == Language::Portuguese.to_string() => Language::Portuguese,
s if s == Language::Russian.to_string() => Language::Russian,
s if s == Language::Urdu.to_string() => Language::Urdu,
_ => Language::English,
}
} else {
Expand Down
Loading

0 comments on commit 8f0ef89

Please sign in to comment.