Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-translate/blob/main/src/langs.rs # aien-translate aien-dev/aien-translate Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-translate / src / langs.rs` 55 lines · 2348 bytes Raw Blame History 1 //! Languages offered, keyed by the ids translate.js uses. 2 3 pub struct Lang { 4 /// translate.js language id, e.g. "chinese_simplified". 5 pub id: &'static str, 6 /// Name shown in the translate.js language picker. 7 pub name: &'static str, 8 /// English name, used in the prompt to the model. 9 pub english: &'static str, 10 /// ISO-style code, reported as translate.js `serviceId`. 11 pub code: &'static str, 12 } 13 14 const fn l(id: &'static str, name: &'static str, english: &'static str, code: &'static str) -> Lang { 15 Lang { id, name, english, code } 16 } 17 18 pub const LANGS: &[Lang] = &[ 19 l("english", "English", "English", "en"), 20 l("chinese_simplified", "简体中文", "Simplified Chinese", "zh-CN"), 21 l("chinese_traditional", "繁體中文", "Traditional Chinese", "zh-TW"), 22 l("japanese", "日本語", "Japanese", "ja"), 23 l("korean", "한국어", "Korean", "ko"), 24 l("spanish", "Español", "Spanish", "es"), 25 l("french", "Français", "French", "fr"), 26 l("deutsch", "Deutsch", "German", "de"), 27 l("portuguese", "Português", "Portuguese", "pt"), 28 l("italian", "Italiano", "Italian", "it"), 29 l("russian", "Русский", "Russian", "ru"), 30 l("ukrainian", "Українська", "Ukrainian", "uk"), 31 l("polish", "Polski", "Polish", "pl"), 32 l("dutch", "Nederlands", "Dutch", "nl"), 33 l("swedish", "Svenska", "Swedish", "sv"), 34 l("danish", "Dansk", "Danish", "da"), 35 l("norwegian", "Norsk", "Norwegian", "no"), 36 l("finnish", "Suomi", "Finnish", "fi"), 37 l("czech", "Čeština", "Czech", "cs"), 38 l("romanian", "Română", "Romanian", "ro"), 39 l("hungarian", "Magyar", "Hungarian", "hu"), 40 l("greek", "Ελληνικά", "Greek", "el"), 41 l("turkish", "Türkçe", "Turkish", "tr"), 42 l("arabic", "العربية", "Arabic", "ar"), 43 l("persian", "فارسی", "Persian", "fa"), 44 l("hindi", "हिन्दी", "Hindi", "hi"), 45 l("bengali", "বাংলা", "Bengali", "bn"), 46 l("thai", "ไทย", "Thai", "th"), 47 l("vietnamese", "Tiếng Việt", "Vietnamese", "vi"), 48 l("indonesian", "Bahasa Indonesia", "Indonesian", "id"), 49 l("malay", "Bahasa Melayu", "Malay", "ms"), 50 ]; 51 52 pub fn find(id: &str) -> Option<&'static Lang> { 53 let id = id.trim(); 54 LANGS.iter().find(|l| l.id.eq_ignore_ascii_case(id) || l.code.eq_ignore_ascii_case(id)) 55 }