add translators.json

This commit is contained in:
Ward from fusion-voyager-3 2024-02-25 20:39:54 +03:00
parent b776768c3f
commit aa05bbcc4b
3 changed files with 7 additions and 7 deletions

View File

@ -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/

2
debian/rules vendored
View File

@ -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/

View File

@ -71,9 +71,9 @@ pub fn welcome_content_page(window: &adw::ApplicationWindow, content_box: &gtk::
let mut dev_json_array: Vec<GString> = 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: &gtk::
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())
}