From aa05bbcc4b156f3e2ce72c551cb0949c645f35d4 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Sun, 25 Feb 2024 20:39:54 +0300 Subject: [PATCH] add translators.json --- Makefile | 2 +- debian/rules | 2 +- src/welcome_content_page/mod.rs | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 7175640..29634e8 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ install: cargo build --release cp -vf target/release/pika-welcome $(DESTDIR)/usr/bin/ chmod 755 $(DESTDIR)/usr/bin/pika-welcome - cp -vf data/bin/pika-welcome $(DESTDIR)/usr/bin/pika-welcome-autostart + cp -vf data/bin/pika-welcome-autostart $(DESTDIR)/usr/bin/ chmod 755 $(DESTDIR)/usr/bin/pika-welcome-autostart mkdir -p $(DESTDIR)/usr/share/glib-2.0/schemas/ mkdir -p $(DESTDIR)/usr/share/ diff --git a/debian/rules b/debian/rules index 3ec4d53..603aecc 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,7 @@ override_dh_auto_install: /root/.cargo/bin/cargo build --release cp -vf target/release/pika-welcome debian/pika-welcome/usr/bin/ chmod 755 debian/pika-welcome/usr/bin/pika-welcome - cp -vf data/bin/pika-welcome debian/pika-welcome/usr/bin/pika-welcome-autostart + cp -vf data/bin/pika-welcome-autostart debian/pika-welcome/usr/bin/ chmod 755 debian/pika-welcome/usr/bin/pika-welcome-autostart mkdir -p debian/pika-welcome/usr/share/glib-2.0/schemas/ mkdir -p debian/pika-welcome/usr/share/ diff --git a/src/welcome_content_page/mod.rs b/src/welcome_content_page/mod.rs index 27b8638..3161c1f 100644 --- a/src/welcome_content_page/mod.rs +++ b/src/welcome_content_page/mod.rs @@ -71,9 +71,9 @@ pub fn welcome_content_page(window: &adw::ApplicationWindow, content_box: >k:: let mut dev_json_array: Vec = Vec::new(); let dev_json_path = "/usr/share/pika-welcome/config/credits.json"; let dev_json_data = std::fs::read_to_string(dev_json_path).expect("Unable to read json"); - let dev_json_data: serde_json::Value = + let dev_json: serde_json::Value = serde_json::from_str(&dev_json_data).expect("JSON format invalid"); - if let serde_json::Value::Array(developers) = &dev_json_data["developers"] { + if let serde_json::Value::Array(developers) = &dev_json["developers"] { for developer in developers { dev_json_array.push(developer["dev"].as_str().to_owned().unwrap().into()) } @@ -81,10 +81,10 @@ pub fn welcome_content_page(window: &adw::ApplicationWindow, content_box: >k:: let mut translator_json_array: Vec<&str> = Vec::new(); let translator_json_path = "/usr/share/pika-welcome/config/translators.json"; - let translator_json_data = std::fs::read_to_string(dev_json_path).expect("Unable to read json"); - let translator_json_data: serde_json::Value = + let translator_json_data = std::fs::read_to_string(translator_json_path).expect("Unable to read json"); + let translator_json: serde_json::Value = serde_json::from_str(&translator_json_data).expect("JSON format invalid"); - if let serde_json::Value::Array(translators) = &dev_json_data["translators"] { + if let serde_json::Value::Array(translators) = &translator_json["translators"] { for translator in translators { translator_json_array.push(translator["translator"].as_str().to_owned().unwrap()) }