-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
351 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
use gettextrs::{gettext, ngettext}; | ||
use std::path::PathBuf; | ||
|
||
pub fn setup_gettext() { | ||
let mut text_domain = gettextrs::TextDomain::new(crate::APP_ID); | ||
|
||
if cfg!(debug_assertions) { | ||
let assets_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")) | ||
.join("..") | ||
.join("assets"); | ||
text_domain = text_domain.push(assets_dir); | ||
} | ||
|
||
if let Err(error) = text_domain.init() { | ||
println!("Failed to setup gettext: {}", error); | ||
}; | ||
} | ||
|
||
/// Like `gettext`, but replaces named variables with the given dictionary. | ||
/// | ||
/// The expected format to replace is `{name}`, where `name` is the first string | ||
/// in the dictionary entry tuple. | ||
pub fn gettext_f(msgid: &str, args: &[(&str, &str)]) -> String { | ||
let s = gettext(msgid); | ||
freplace(s, args) | ||
} | ||
|
||
/// Like `ngettext`, but replaces named variables with the given dictionary. | ||
/// | ||
/// The expected format to replace is `{name}`, where `name` is the first string | ||
/// in the dictionary entry tuple. | ||
#[allow(unused)] | ||
pub fn ngettext_f(msgid: &str, msgid_plural: &str, n: u32, args: &[(&str, &str)]) -> String { | ||
let s = ngettext(msgid, msgid_plural, n); | ||
freplace(s, args) | ||
} | ||
|
||
fn freplace(s: String, args: &[(&str, &str)]) -> String { | ||
let mut s = s; | ||
|
||
for (k, v) in args { | ||
s = s.replace(&format!("{{{k}}}"), v); | ||
} | ||
|
||
s | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
gnome/src/search_window/search_window.blp | ||
gnome/src/error_window/error_window.blp | ||
gnome/src/shortcuts.blp | ||
gnome/src/ui/search_window/search_window.blp | ||
gnome/src/ui/error_window/error_window.blp | ||
gnome/src/ui/shortcuts/shortcuts.blp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: \n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-02 14:53+0200\n" | ||
"POT-Creation-Date: 2024-11-15 11:57+0100\n" | ||
"PO-Revision-Date: 2024-09-26 23:16+0200\n" | ||
"Last-Translator: Amerey <[email protected]>\n" | ||
"Language-Team: \n" | ||
|
@@ -18,114 +18,133 @@ msgstr "" | |
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 3.4.4\n" | ||
|
||
#: gnome/src/search_window/search_window.blp:5 | ||
#: gnome/src/ui/search_window/search_window.blp:5 | ||
msgid "Clapgrep" | ||
msgstr "Clapgrep" | ||
|
||
#: gnome/src/search_window/search_window.blp:9 | ||
#: gnome/src/ui/search_window/search_window.blp:18 | ||
msgid "Search Settings" | ||
msgstr "Nastavení vyhledávání" | ||
|
||
#: gnome/src/search_window/search_window.blp:28 | ||
#: gnome/src/ui/search_window/search_window.blp:41 | ||
msgid "Search Pattern" | ||
msgstr "Vzor vyhledávání" | ||
|
||
#: gnome/src/search_window/search_window.blp:33 gnome/src/shortcuts.blp:28 | ||
#: gnome/src/ui/search_window/search_window.blp:47 | ||
#: gnome/src/ui/shortcuts/shortcuts.blp:28 | ||
msgid "Start Search" | ||
msgstr "Spustit vyhledávání" | ||
|
||
#: gnome/src/search_window/search_window.blp:41 | ||
#: gnome/src/ui/search_window/search_window.blp:55 | ||
msgid "Search Path" | ||
msgstr "Cesta vyhledávání" | ||
|
||
#: gnome/src/search_window/search_window.blp:59 | ||
#: gnome/src/ui/search_window/search_window.blp:73 | ||
msgid "Search Options" | ||
msgstr "Možnosti vyhledávání" | ||
|
||
#: gnome/src/search_window/search_window.blp:62 | ||
#: gnome/src/ui/search_window/search_window.blp:76 | ||
msgid "Case Sensitive" | ||
msgstr "Rozlišovat malá a velká písmena" | ||
|
||
#: gnome/src/search_window/search_window.blp:67 | ||
#: gnome/src/ui/search_window/search_window.blp:81 | ||
msgid "Disable Regex" | ||
msgstr "Zakázat Regex" | ||
|
||
#: gnome/src/search_window/search_window.blp:72 | ||
#: gnome/src/ui/search_window/search_window.blp:86 | ||
msgid "Include Hidden" | ||
msgstr "Zahrnout skryté" | ||
|
||
#: gnome/src/search_window/search_window.blp:77 | ||
#: gnome/src/ui/search_window/search_window.blp:91 | ||
msgid "Include Ignored" | ||
msgstr "Zahrnout ignorované" | ||
|
||
#: gnome/src/search_window/search_window.blp:83 | ||
#: gnome/src/ui/search_window/search_window.blp:97 | ||
msgid "Extra File Formats" | ||
msgstr "Extra formáty souborů" | ||
|
||
#: gnome/src/search_window/search_window.blp:86 | ||
#: gnome/src/ui/search_window/search_window.blp:100 | ||
msgid "PDF files" | ||
msgstr "PDF soubory" | ||
|
||
#: gnome/src/search_window/search_window.blp:91 | ||
#: gnome/src/ui/search_window/search_window.blp:105 | ||
msgid "Office files" | ||
msgstr "Soubory Office" | ||
|
||
#: gnome/src/search_window/search_window.blp:97 | ||
msgid "Current Search" | ||
msgstr "Aktuální vyhledávání" | ||
#: gnome/src/ui/search_window/search_window.blp:116 | ||
msgid "Search Results" | ||
msgstr "Výsledky vyhledávání" | ||
|
||
#: gnome/src/ui/search_window/search_window.blp:136 | ||
msgid "No Search Yet" | ||
msgstr "" | ||
|
||
#: gnome/src/search_window/search_window.blp:102 | ||
msgid "Searched Files" | ||
msgstr "Hledané soubory" | ||
#: gnome/src/ui/search_window/search_window.blp:137 | ||
msgid "Try to start a search" | ||
msgstr "" | ||
|
||
#: gnome/src/search_window/search_window.blp:111 | ||
msgid "Number of Matches" | ||
msgstr "Počet shod" | ||
#: gnome/src/ui/search_window/search_window.blp:146 | ||
msgid "No Results" | ||
msgstr "" | ||
|
||
#: gnome/src/search_window/search_window.blp:120 | ||
msgid "Errors Encountered" | ||
msgstr "Zjištěné chyby" | ||
#: gnome/src/ui/search_window/search_window.blp:152 | ||
msgid "" | ||
"You might want to try changing your search pattern, activating document " | ||
"search, or changing to a different directory" | ||
msgstr "" | ||
|
||
#: gnome/src/search_window/search_window.blp:133 | ||
#: gnome/src/ui/search_window/search_window.blp:182 | ||
msgid "Cancel Search" | ||
msgstr "Zrušit vyhledávání" | ||
|
||
#: gnome/src/search_window/search_window.blp:148 | ||
msgid "Search Results" | ||
msgstr "Výsledky vyhledávání" | ||
#: gnome/src/ui/search_window/search_window.blp:201 | ||
msgid "Show Errors" | ||
msgstr "" | ||
|
||
#: gnome/src/search_window/search_window.blp:238 | ||
#: gnome/src/ui/search_window/search_window.blp:284 | ||
msgid "Keyboard Shortcuts" | ||
msgstr "Klávesové zkratky" | ||
|
||
#: gnome/src/search_window/search_window.blp:243 | ||
#: gnome/src/ui/search_window/search_window.blp:289 | ||
msgid "About Clapgrep" | ||
msgstr "O Clapgrep" | ||
|
||
#: gnome/src/error_window/error_window.blp:7 | ||
#: gnome/src/ui/error_window/error_window.blp:7 | ||
msgid "Search Errors" | ||
msgstr "Chyby vyhledávání" | ||
|
||
#: gnome/src/shortcuts.blp:5 | ||
#: gnome/src/ui/shortcuts/shortcuts.blp:5 | ||
msgid "Clapgrep Shortcuts" | ||
msgstr "Zkratky Clapgrep" | ||
|
||
#: gnome/src/shortcuts.blp:9 | ||
#: gnome/src/ui/shortcuts/shortcuts.blp:9 | ||
msgid "General" | ||
msgstr "Obecné" | ||
|
||
#: gnome/src/shortcuts.blp:12 | ||
#: gnome/src/ui/shortcuts/shortcuts.blp:12 | ||
msgid "Quit" | ||
msgstr "Konec" | ||
|
||
#: gnome/src/shortcuts.blp:18 | ||
#: gnome/src/ui/shortcuts/shortcuts.blp:18 | ||
msgid "Shortcuts" | ||
msgstr "Zkratky" | ||
|
||
#: gnome/src/shortcuts.blp:25 | ||
#: gnome/src/ui/shortcuts/shortcuts.blp:25 | ||
msgid "Control Search" | ||
msgstr "Ovládání vyhledávání" | ||
|
||
#: gnome/src/shortcuts.blp:34 | ||
#: gnome/src/ui/shortcuts/shortcuts.blp:34 | ||
msgid "Stop Search" | ||
msgstr "Zastavit vyhledávání" | ||
|
||
#~ msgid "Current Search" | ||
#~ msgstr "Aktuální vyhledávání" | ||
|
||
#~ msgid "Searched Files" | ||
#~ msgstr "Hledané soubory" | ||
|
||
#~ msgid "Number of Matches" | ||
#~ msgstr "Počet shod" | ||
|
||
#~ msgid "Errors Encountered" | ||
#~ msgstr "Zjištěné chyby" |
Oops, something went wrong.