Translation button (#526)
This commit is contained in:
parent
5be801e763
commit
25301eb56e
|
@ -5,6 +5,7 @@ use crate::gui_data::GuiData;
|
||||||
const SPONSOR_SITE: &str = "https://github.com/sponsors/qarmin";
|
const SPONSOR_SITE: &str = "https://github.com/sponsors/qarmin";
|
||||||
const REPOSITORY_SITE: &str = "https://github.com/qarmin/czkawka";
|
const REPOSITORY_SITE: &str = "https://github.com/qarmin/czkawka";
|
||||||
const INSTRUCTION_SITE: &str = "https://github.com/qarmin/czkawka/blob/master/instructions/Instruction.md";
|
const INSTRUCTION_SITE: &str = "https://github.com/qarmin/czkawka/blob/master/instructions/Instruction.md";
|
||||||
|
const TRANSLATION_SITE: &str = "https://crwd.in/czkawka";
|
||||||
|
|
||||||
pub fn connect_about_buttons(gui_data: &GuiData) {
|
pub fn connect_about_buttons(gui_data: &GuiData) {
|
||||||
let button_donation = gui_data.about.button_donation.clone();
|
let button_donation = gui_data.about.button_donation.clone();
|
||||||
|
@ -31,4 +32,12 @@ pub fn connect_about_buttons(gui_data: &GuiData) {
|
||||||
// println!("Failed to open repository site: {}, reason {}", REPOSITORY_SITE, e)
|
// println!("Failed to open repository site: {}, reason {}", REPOSITORY_SITE, e)
|
||||||
// };
|
// };
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let button_translation = gui_data.about.button_translation.clone();
|
||||||
|
button_translation.connect_clicked(move |_| {
|
||||||
|
open::that_in_background(TRANSLATION_SITE);
|
||||||
|
// if let Err(e) = open::that(TRANSLATION_SITE) {
|
||||||
|
// println!("Failed to open repository site: {}, reason {}", TRANSLATION_SITE, e)
|
||||||
|
// };
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ pub struct GuiAbout {
|
||||||
pub button_repository: gtk::Button,
|
pub button_repository: gtk::Button,
|
||||||
pub button_donation: gtk::Button,
|
pub button_donation: gtk::Button,
|
||||||
pub button_instruction: gtk::Button,
|
pub button_instruction: gtk::Button,
|
||||||
|
pub button_translation: gtk::Button,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GuiAbout {
|
impl GuiAbout {
|
||||||
|
@ -24,12 +25,14 @@ impl GuiAbout {
|
||||||
let button_repository: gtk::Button = builder.object("button_repository").unwrap();
|
let button_repository: gtk::Button = builder.object("button_repository").unwrap();
|
||||||
let button_donation: gtk::Button = builder.object("button_donation").unwrap();
|
let button_donation: gtk::Button = builder.object("button_donation").unwrap();
|
||||||
let button_instruction: gtk::Button = builder.object("button_instruction").unwrap();
|
let button_instruction: gtk::Button = builder.object("button_instruction").unwrap();
|
||||||
|
let button_translation: gtk::Button = builder.object("button_translation").unwrap();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
about_dialog,
|
about_dialog,
|
||||||
button_repository,
|
button_repository,
|
||||||
button_donation,
|
button_donation,
|
||||||
button_instruction,
|
button_instruction,
|
||||||
|
button_translation,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn update_language(&self) {
|
pub fn update_language(&self) {
|
||||||
|
@ -40,9 +43,11 @@ impl GuiAbout {
|
||||||
self.button_repository.set_tooltip_text(Some(&fl!("about_repository_button_tooltip")));
|
self.button_repository.set_tooltip_text(Some(&fl!("about_repository_button_tooltip")));
|
||||||
self.button_donation.set_tooltip_text(Some(&fl!("about_donation_button_tooltip")));
|
self.button_donation.set_tooltip_text(Some(&fl!("about_donation_button_tooltip")));
|
||||||
self.button_instruction.set_tooltip_text(Some(&fl!("about_instruction_button_tooltip")));
|
self.button_instruction.set_tooltip_text(Some(&fl!("about_instruction_button_tooltip")));
|
||||||
|
self.button_translation.set_tooltip_text(Some(&fl!("about_translation_button_tooltip")));
|
||||||
|
|
||||||
self.button_repository.set_label(&fl!("about_repository_button"));
|
self.button_repository.set_label(&fl!("about_repository_button"));
|
||||||
self.button_donation.set_label(&fl!("about_donation_button"));
|
self.button_donation.set_label(&fl!("about_donation_button"));
|
||||||
self.button_instruction.set_label(&fl!("about_instruction_button"));
|
self.button_instruction.set_label(&fl!("about_instruction_button"));
|
||||||
|
self.button_translation.set_label(&fl!("about_translation_button"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ pub const IMAGES_HASH_TYPE_COMBO_BOX: [ImageHashTypeStruct; 5] = [
|
||||||
hash_alg: HashAlg::VertGradient,
|
hash_alg: HashAlg::VertGradient,
|
||||||
},
|
},
|
||||||
ImageHashTypeStruct {
|
ImageHashTypeStruct {
|
||||||
eng_name: "Blackhash",
|
eng_name: "Blockhash",
|
||||||
hash_alg: HashAlg::Blockhash,
|
hash_alg: HashAlg::Blockhash,
|
||||||
},
|
},
|
||||||
ImageHashTypeStruct {
|
ImageHashTypeStruct {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.38.2
|
<!-- Generated with glade 3.39.0
|
||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
@ -111,11 +111,24 @@ This program is free to use and will always be.
|
||||||
<property name="position">2</property>
|
<property name="position">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button_translation">
|
||||||
|
<property name="label" translatable="yes">Translation</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="position">2</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -202,9 +202,11 @@ progress_stop_button = Stoppen
|
||||||
about_repository_button_tooltip = Link zur Repository-Seite mit Quellcode.
|
about_repository_button_tooltip = Link zur Repository-Seite mit Quellcode.
|
||||||
about_donation_button_tooltip = Link zur Spendenseite.
|
about_donation_button_tooltip = Link zur Spendenseite.
|
||||||
about_instruction_button_tooltip = Link zur Anweisungsseite.
|
about_instruction_button_tooltip = Link zur Anweisungsseite.
|
||||||
|
about_translation_button_tooltip = Link zur Crowdin-Seite mit App-Übersetzungen. Offiziell werden Polnisch und Englisch unterstützt, aber jede Hilfe mit anderen Sprachen wird geschätzt.
|
||||||
about_repository_button = Projektarchiv
|
about_repository_button = Projektarchiv
|
||||||
about_donation_button = Spende
|
about_donation_button = Spende
|
||||||
about_instruction_button = Anleitung
|
about_instruction_button = Anleitung
|
||||||
|
about_translation_button = Übersetzung
|
||||||
# Header
|
# Header
|
||||||
header_setting_button_tooltip = Öffnet Einstellungsdialog.
|
header_setting_button_tooltip = Öffnet Einstellungsdialog.
|
||||||
header_about_button_tooltip = Öffnet den Dialog mit Informationen über die App.
|
header_about_button_tooltip = Öffnet den Dialog mit Informationen über die App.
|
||||||
|
|
|
@ -243,10 +243,12 @@ progress_stop_button = Stop
|
||||||
about_repository_button_tooltip = Link to repository page with source code.
|
about_repository_button_tooltip = Link to repository page with source code.
|
||||||
about_donation_button_tooltip = Link to donation page.
|
about_donation_button_tooltip = Link to donation page.
|
||||||
about_instruction_button_tooltip = Link to instruction page.
|
about_instruction_button_tooltip = Link to instruction page.
|
||||||
|
about_translation_button_tooltip = Link to Crowdin page with app translations. Officially Polish and English are supported, but any help with other language will be appreciated.
|
||||||
|
|
||||||
about_repository_button = Repository
|
about_repository_button = Repository
|
||||||
about_donation_button = Donation
|
about_donation_button = Donation
|
||||||
about_instruction_button = Instruction
|
about_instruction_button = Instruction
|
||||||
|
about_translation_button = Translation
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
header_setting_button_tooltip = Opens settings dialog.
|
header_setting_button_tooltip = Opens settings dialog.
|
||||||
|
|
|
@ -243,10 +243,12 @@ progress_stop_button = Ferma
|
||||||
about_repository_button_tooltip = Collegamento alla pagina del codice sorgente nell'archivio.
|
about_repository_button_tooltip = Collegamento alla pagina del codice sorgente nell'archivio.
|
||||||
about_donation_button_tooltip = Collegamento alla pagina delle donazioni.
|
about_donation_button_tooltip = Collegamento alla pagina delle donazioni.
|
||||||
about_instruction_button_tooltip = Colegamento alla pagina delle istruzioni.
|
about_instruction_button_tooltip = Colegamento alla pagina delle istruzioni.
|
||||||
|
about_translation_button_tooltip = Link alla pagina di Crowdin con le traduzioni delle app. Ufficialmente sono supportati il polacco e l'inglese, ma qualsiasi aiuto con altre lingue sarà apprezzato.
|
||||||
|
|
||||||
about_repository_button = Archivio
|
about_repository_button = Archivio
|
||||||
about_donation_button = Donazioni
|
about_donation_button = Donazioni
|
||||||
about_instruction_button = Istruzioni
|
about_instruction_button = Istruzioni
|
||||||
|
about_translation_button = Traduzione
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
header_setting_button_tooltip = Apre la finestra impostazioni.
|
header_setting_button_tooltip = Apre la finestra impostazioni.
|
||||||
|
|
|
@ -202,9 +202,11 @@ progress_stop_button = Stop
|
||||||
about_repository_button_tooltip = Link do repozytorium z kodem źródłowym
|
about_repository_button_tooltip = Link do repozytorium z kodem źródłowym
|
||||||
about_donation_button_tooltip = Link do strony z dotacjami.
|
about_donation_button_tooltip = Link do strony z dotacjami.
|
||||||
about_instruction_button_tooltip = Link do strony z instrukcją.
|
about_instruction_button_tooltip = Link do strony z instrukcją.
|
||||||
|
about_translation_button_tooltip = Link do strony z tłumaczeniami - Crowdin. Oficialnie język polski i angielski są wspierane, jednak za pomoc przy poprawie bieżących tekstów i tłumaczeniu ich na inny język, byłbym wdzięczny.
|
||||||
about_repository_button = Repozytorium
|
about_repository_button = Repozytorium
|
||||||
about_donation_button = Dotacje
|
about_donation_button = Dotacje
|
||||||
about_instruction_button = Instrukcja(ENG)
|
about_instruction_button = Instrukcja(ENG)
|
||||||
|
about_translation_button = Tłumaczenie
|
||||||
# Header
|
# Header
|
||||||
header_setting_button_tooltip = Otwórz okno z ustawieniami programu.
|
header_setting_button_tooltip = Otwórz okno z ustawieniami programu.
|
||||||
header_about_button_tooltip = Otwórz okno z informacjami o programie.
|
header_about_button_tooltip = Otwórz okno z informacjami o programie.
|
||||||
|
|
Loading…
Reference in a new issue