mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
This commit is contained in:
26
src/lang.rs
26
src/lang.rs
@@ -1,21 +1,43 @@
|
||||
use serde_json::{json, value::Value};
|
||||
use std::ops::Deref;
|
||||
|
||||
mod cn;
|
||||
mod cs;
|
||||
mod da;
|
||||
mod sk;
|
||||
mod de;
|
||||
mod en;
|
||||
mod es;
|
||||
mod eo;
|
||||
mod es;
|
||||
mod fr;
|
||||
mod id;
|
||||
mod it;
|
||||
mod ptbr;
|
||||
mod ru;
|
||||
mod sk;
|
||||
mod tr;
|
||||
mod tw;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
pub static ref LANGS: Value =
|
||||
json!(vec![
|
||||
("en", "English"),
|
||||
("it", "Italiano"),
|
||||
("fr", "Français"),
|
||||
("de", "Deutsch"),
|
||||
("cn", "简体中文"),
|
||||
("tw", "繁體中文"),
|
||||
("pt", "Português"),
|
||||
("es", "Español"),
|
||||
("ru", "Русский"),
|
||||
("sk", "Slovenčina"),
|
||||
("id", "Indonesia"),
|
||||
("cs", "Čeština"),
|
||||
("da", "Dansk"),
|
||||
("eo", "Esperanto"),
|
||||
("tr", "Türkçe"),
|
||||
]);
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn translate(name: String) -> String {
|
||||
let locale = sys_locale::get_locale().unwrap_or_default().to_lowercase();
|
||||
|
||||
Reference in New Issue
Block a user