move languages into tauri resources

This commit is contained in:
SpikeHD
2022-05-17 17:23:05 -07:00
parent 76cfec3ac2
commit 5006c08ea7
2 changed files with 2 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ pub async fn get_lang(window: tauri::Window, lang: String) -> String {
let lang = lang.to_lowercase();
// Send contents of language file back
let contents = match std::fs::read_to_string(format!("../lang/{}.json", lang)) {
let contents = match std::fs::read_to_string(format!("./resources/lang/{}.json", lang)) {
Ok(x) => x,
Err(e) => {
emit_lang_err(window, format!("Failed to read language file: {}", e));
@@ -19,7 +19,7 @@ pub async fn get_languages() -> std::collections::HashMap<String, String> {
// for each lang file, set the key as the filename and the value as the lang_name contained in the file
let mut languages = std::collections::HashMap::new();
let mut lang_files = std::fs::read_dir("../lang").unwrap();
let mut lang_files = std::fs::read_dir("./resources/lang").unwrap();
while let Some(entry) = lang_files.next() {
let entry = entry.unwrap();