Skip to content

Commit

Permalink
Merge pull request #11 from Qustio/main
Browse files Browse the repository at this point in the history
Fixed panic on unwrapping $XDG_CACHE_HOME
  • Loading branch information
youpie authored Aug 10, 2024
2 parents e04d87f + 9b66d0b commit 85299c5
Show file tree
Hide file tree
Showing 4 changed files with 340 additions and 32 deletions.
1 change: 1 addition & 0 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
hi
it
nl
290 changes: 290 additions & 0 deletions po/hi.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
# Hindi translation for Iconic.
# Copyright (C) 2024 Iconic's COPYRIGHT HOLDER
# This file is distributed under the same license as the Iconic package.
# Scrambled777 <weblate.scrambled777@simplelogin.com>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: Iconic\n"
"Report-Msgid-Bugs-To: https://github.com/youpie/Folder_icon_creator\n"
"POT-Creation-Date: 2024-07-23 13:26+0200\n"
"PO-Revision-Date: 2024-08-05 23:03+0530\n"
"Last-Translator: Scrambled777 <weblate.scrambled777@simplelogin.com>\n"
"Language-Team: Hindi <indlinux-hindi@lists.sourceforge.net>\n"
"Language: hi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Gtranslator 46.1\n"

#: data/nl.emphisia.icon.desktop.in.in:3
#: data/nl.emphisia.icon.metainfo.xml.in.in:5
#: data/nl.emphisia.icon.metainfo.xml.in.in:82
msgid "Iconic"
msgstr "आइकोनिक"

#: data/nl.emphisia.icon.metainfo.xml.in.in:6
msgid "Easilly add icons on top of folders"
msgstr "फोल्डरों के शीर्ष पर आसानी से आइकन जोड़ें"

#: data/nl.emphisia.icon.metainfo.xml.in.in:8
msgid "Youpie"
msgstr "Youpie"

#: data/nl.emphisia.icon.metainfo.xml.in.in:14
msgid ""
"This program allows an easy and intuitive way to add an icon on top of a "
"folder to help you differentiate it better."
msgstr ""
"यह प्रोग्राम एक आसान और सहज तरीके से किसी फोल्डर के शीर्ष पर एक आइकन जोड़ने की अनुमति "
"देता है, जिससे आपको इसे बेहतर ढंग से पहचानने में मदद मिलती है।"

#: data/nl.emphisia.icon.metainfo.xml.in.in:15
msgid ""
"This program is written in Rust and Libadwaita and is my first attempt at "
"creating an application"
msgstr ""
"यह प्रोग्राम Rust और Libadwaita में लिखा गया है और यह एप्लिकेशन बनाने का मेरा पहला "
"प्रयास है"

#: data/nl.emphisia.icon.metainfo.xml.in.in:19
msgid "Begin screen of application"
msgstr "एप्लिकेशन की आरंभिक स्क्रीन"

#: data/nl.emphisia.icon.metainfo.xml.in.in:23
msgid "Main menu in light mode"
msgstr "लाइट मोड में मुख्य मेनू"

#: data/nl.emphisia.icon.metainfo.xml.in.in:27
msgid "Main menu in dark mode"
msgstr "डार्क मोड में मुख्य मेनू"

#: data/nl.emphisia.icon.metainfo.xml.in.in:34
msgid "Another small update with a few additions and changes"
msgstr "कुछ अतिरिक्त और परिवर्तनों के साथ एक और छोटा अपडेट"

#: data/nl.emphisia.icon.metainfo.xml.in.in:36
msgid "You can now open containing folder after saving image"
msgstr "अब आप छवि सहेजने के बाद संबंधित फोल्डर खोल सकते हैं"

#: data/nl.emphisia.icon.metainfo.xml.in.in:37
msgid "Added italian translation"
msgstr "इतालवी अनुवाद जोड़ा गया"

#: data/nl.emphisia.icon.metainfo.xml.in.in:38
msgid "Updated Dutch translation"
msgstr "डच अनुवाद अद्यतित"

#: data/nl.emphisia.icon.metainfo.xml.in.in:44
msgid "This version adds a few small features and fixes some bugs"
msgstr "इस संस्करण में कुछ छोटी खासियतें जोड़ी गई हैं और कुछ बगों को ठीक किया गया है"

#: data/nl.emphisia.icon.metainfo.xml.in.in:46
msgid "The app now shows some errors as pop-ups"
msgstr "ऐप अब कुछ त्रुटियां पॉप-अप के रूप में दिखाता है"

#: data/nl.emphisia.icon.metainfo.xml.in.in:47
msgid "You can now temporarilly open a new folder image"
msgstr "अब आप अस्थायी रूप से एक नई फोल्डर छवि खोल सकते हैं"

#: data/nl.emphisia.icon.metainfo.xml.in.in:48
msgid "It now first shows a pop-up when the folder image is not found"
msgstr "अब जब फोल्डर छवि नहीं मिलती है तो यह सबसे पहले एक पॉप-अप दिखाता है"

#: data/nl.emphisia.icon.metainfo.xml.in.in:54
msgid "Initial release"
msgstr "प्रारंभिक रिलीज़"

#: data/nl.emphisia.icon.metainfo.xml.in.in:73
msgid "icon"
msgstr "आइकन"

#: data/nl.emphisia.icon.metainfo.xml.in.in:74
msgid "create"
msgstr "बनाएं"

#: data/nl.emphisia.icon.metainfo.xml.in.in:75
msgid "folder icon"
msgstr "फोल्डर आइकन"

#: data/nl.emphisia.icon.metainfo.xml.in.in:76
msgid "svg"
msgstr "SVG"

#: data/nl.emphisia.icon.metainfo.xml.in.in:77
msgid "png"
msgstr "PNG"

#: data/nl.emphisia.icon.metainfo.xml.in.in:78
msgid "gnome"
msgstr "गनोम"

#: data/nl.emphisia.icon.metainfo.xml.in.in:79
msgid "icon create"
msgstr "आइकन बनाएं"

#: data/nl.emphisia.icon.metainfo.xml.in.in:80
msgid "icon creator"
msgstr "आइकन निर्माता"

#: data/nl.emphisia.icon.metainfo.xml.in.in:81
msgid "folder icon creator"
msgstr "फोल्डर आइकन निर्माता"

#: src/gtk/help-overlay.blp:11
msgctxt "shortcut window"
msgid "General"
msgstr "सामान्य"

#: src/gtk/help-overlay.blp:14
msgctxt "shortcut window"
msgid "Show Shortcuts"
msgstr "शॉर्टकट दिखाएं"

#: src/gtk/help-overlay.blp:19
msgctxt "shortcut window"
msgid "Quit"
msgstr "बंद करें"

#: src/gtk/help-overlay.blp:24
msgctxt "shortcut window"
msgid "Save"
msgstr "सहेजें"

#: src/gtk/help-overlay.blp:29
msgctxt "shortcut window"
msgid "Open top image"
msgstr "शीर्ष छवि खोलें"

#: src/gtk/help-overlay.blp:34
msgctxt "shortcut window"
msgid "Open temporary folder image"
msgstr "अस्थायी फोल्डर छवि खोलें"

#: src/settings/settings.blp:8
msgid "General"
msgstr "सामान्य"

#: src/settings/settings.blp:11
msgid "Customise"
msgstr "अनुकूलित करें"

#: src/settings/settings.blp:29
msgid "Currently set folder icon, click to reset to default"
msgstr "वर्तमान में निर्धारित फोल्डर आइकन, तयशुदा पर रीसेट करने के लिए क्लिक करें"

#: src/settings/settings.blp:35
msgid "Advanced"
msgstr "उन्नत"

#: src/settings/settings.blp:38
msgid "You can see these options because you have enabled the Devel profile"
msgstr "आप ये विकल्प इसलिए देख सकते हैं क्योंकि आपने Devel प्रोफाइल सक्षम कर रखी है"

#: src/settings/settings.blp:46
msgid "Select size of SVG images"
msgstr "SVG छवियों का आकार चुनें"

#: src/settings/settings.blp:47
msgid ""
"SVG images will by default be converted to a 1024x1024 image. You can adjust "
"that here"
msgstr ""
"SVG छवियां तयशुदा रूप से 1024x1024 छवि में परिवर्तित की जाएंगी। आप इसे यहां समायोजित "
"कर सकते हैं"

#: src/settings/settings.blp:57
msgid "Select size of Thumbnail images"
msgstr "थंबनेल छवियों का आकार चुनें"

#: src/settings/settings.blp:58
msgid ""
"Thumbnail images will by default be converted to a 255x255 image. You can "
"adjust that here"
msgstr ""
"थंबनेल छवियां तयशुदा रूप से 255x255 छवि में परिवर्तित की जाएंगी। आप इसे यहां समायोजित कर "
"सकते हैं"

#: src/window.blp:25 src/window.blp:82
msgid "Menu"
msgstr "मेनू"

#: src/window.blp:31
msgid "Folder Icon Creator"
msgstr "फोल्डर आइकन निर्माता"

#: src/window.blp:32
msgid "Click to Open Image"
msgstr "छवि खोलने के लिए क्लिक करें"

#: src/window.blp:43
msgid "_Open Image"
msgstr "छवि खोलें (_O)"

#: src/window.blp:277
msgid "_Open Top Icon"
msgstr "शीर्ष आइकन खोलें (_O)"

#: src/window.blp:282
msgid "_Open Folder Icon"
msgstr "फोल्डर आइकन खोलें (_O)"

#: src/window.blp:288
msgid "_Preferences"
msgstr "प्राथमिकताएं (_P)"

#: src/window.blp:293
msgid "_Keyboard Shortcuts"
msgstr "कीबोर्ड शॉर्टकट (_K)"

#: src/window.blp:298
msgid "_About folder icon maker"
msgstr "आइकोनिक के बारे में (_A)"

#: src/settings/settings.rs:151 src/window.rs:559
msgid "Open Document"
msgstr "दस्तावेज खोलें"

#: src/settings/settings.rs:187 src/window.rs:366
msgid "Error"
msgstr "त्रुटि"

#: src/window.rs:342
msgid "The set folder icon could not be found, press ok to select a new one"
msgstr "निर्धारित फोल्डर आइकन नहीं मिल सका, नया चुनने के लिए 'ठीक है' दबाएं"

#: src/window.rs:370
msgid "OK"
msgstr "ठीक है"

#: src/window.rs:389
msgid "Save Changes?"
msgstr "परिवर्तन सहेजें?"

#: src/window.rs:390
msgid ""
"Open image contain unsaved changes. Changes which are not saved will be "
"permanently lost"
msgstr ""
"खुली छवि में सहेजे न गए परिवर्तन हैं। जो परिवर्तन सहेजे नहीं गए वे स्थायी रूप से नष्ट हो जाएंगे"

#: src/window.rs:394
msgid "Cancel"
msgstr "रद्द करें"

#: src/window.rs:395
msgid "Discard"
msgstr "त्यागें"

#: src/window.rs:397
msgid "Save"
msgstr "सहेजें"

#: src/window.rs:457
msgid "Open Folder"
msgstr "फोल्डर खोलें"

#: src/window.rs:459
msgid "File Saved"
msgstr "फाइल सहेजी गई"
17 changes: 14 additions & 3 deletions src/settings/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::glib::clone;
use gtk::*;
use gettextrs::*;
use crate::config::{APP_ID, PROFILE};
use std::path::PathBuf;
use std::{env,fs,path};
use adw::prelude::AlertDialogExt;
use adw::prelude::AdwDialogExt;
Expand Down Expand Up @@ -171,11 +172,21 @@ impl PreferencesWindow {
}

fn copy_folder_image_to_cache(&self, original_path: path::PathBuf) -> Results<()>{
let cache_dir = env::var("XDG_CACHE_HOME")?;
let cache_dir = match env::var("XDG_CACHE_HOME") {
Ok(value) => PathBuf::from(value),
Err(_) => {
let config_dir = PathBuf::from(env::var("HOME").unwrap())
.join(".cache")
.join("Iconic");
if !config_dir.exists() {
fs::create_dir(&config_dir).unwrap();
}
config_dir
}
};
let file_name = format!("folder.{}",original_path.extension().unwrap().to_str().unwrap());
self.imp().settings.set("folder-cache-name",file_name.clone())?;
let mut cache_path = path::PathBuf::from(cache_dir);
cache_path.push(file_name);
let cache_path = cache_dir.join(file_name);
fs::copy(original_path,cache_path)?;
Ok(())
}
Expand Down
Loading

0 comments on commit 85299c5

Please sign in to comment.