diff --git a/po/LINGUAS b/po/LINGUAS index e69de29..841618a 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -0,0 +1 @@ +cs diff --git a/po/POTFILES b/po/POTFILES index 8df8036..a0f2862 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,6 +1,5 @@ data/cz.ogion.Nonemast.desktop.in data/cz.ogion.Nonemast.appdata.xml.in -data/cz.ogion.Nonemast.gschema.xml src/nonemast/main.py src/nonemast/update-details.ui src/nonemast/update-details-commit-item.ui diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 0000000..2afabb8 --- /dev/null +++ b/po/cs.po @@ -0,0 +1,157 @@ +# Czech translations for nonemast package. +# Copyright (C) 2023 THE nonemast'S COPYRIGHT HOLDER +# This file is distributed under the same license as the nonemast package. +# Automatically generated, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: nonemast\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-16 23:19+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: data/cz.ogion.Nonemast.desktop.in:3 src/nonemast/main.py:58 +#: src/nonemast/window.ui:21 +msgid "Not Nearly Enough Masking Tape" +msgstr "Ani zdaleka ne dost maskovací pásky" + +#: data/cz.ogion.Nonemast.appdata.xml.in:7 +msgid "Tool for reviewing GNOME update Nixpkgs PRs." +msgstr "" +"Nástroj pro kontrolu požadavků na začlenění do Nixpkgs obsahujících " +"aktualizace GNOME." + +#: data/cz.ogion.Nonemast.appdata.xml.in:12 +msgid "Main view of GNOME 43 update" +msgstr "Hlavní pohled na aktualizaci GNOME 43" + +#: src/nonemast/main.py:39 +msgid "error: nonemast expects exactly one path as an argument." +msgstr "chyba: nonemast očekává právě jednu cestu jako argument." + +#: src/nonemast/main.py:63 +msgid "translator-credits" +msgstr "Jan Tojnar" + +#: src/nonemast/main.py:64 +msgid "© 2022 Jan Tojnar" +msgstr "© 2022 Jan Tojnar" + +#: src/nonemast/update-details.ui:7 +msgid "Changelog" +msgstr "Seznam změn" + +#: src/nonemast/update-details.ui:34 +msgid "Mark as reviewed" +msgstr "Označit jako zkontrolované" + +#: src/nonemast/update-details.ui:48 +msgid "Final commit message" +msgstr "Výsledná zpráva revize" + +#: src/nonemast/update-details.ui:82 +msgid "Edit" +msgstr "Upravit" + +#: src/nonemast/update-details.ui:97 +msgid "Currently editing" +msgstr "Přávě upravováno" + +#: src/nonemast/update-details.ui:108 +msgid "Commits" +msgstr "Revize" + +#: src/nonemast/update-details-commit-item.ui:26 +msgid "View in external tool" +msgstr "Zobrazit v externím nástroji" + +#: src/nonemast/update-item.ui:34 +msgid "Changelog reviewed" +msgstr "Změny zkontrolovány" + +#: src/nonemast/window.py:56 +msgid "Unable to find a text editor for editing commit messages." +msgstr "Nelze najít textový editor pro úpravu zpráv revizí." + +#: src/nonemast/window.py:80 +msgid "Unable to find a tool for viewing Git commits." +msgstr "Nelze najít nástroj pro zobrazování revizí Gitu." + +#: src/nonemast/window.py:336 +msgid "Missing Git Identity" +msgstr "Chybějící totožnost pro Git." + +#: src/nonemast/window.py:338 +#, python-format +msgid "" +"Please %(your_identity_link_start)s configure Git with your name and e-mail " +"address %(your_identity_link_end)s for commit authorship." +msgstr "" + +#: src/nonemast/window.py:346 +msgid "" +"https://www.git-scm.com/book/en/v2/Getting-Started-First-Time-Git-" +"Setup#_your_identity" +msgstr "" +"https://www.git-scm.com/book/cs/v2/%C3%9Avod-Prvn%C3%AD-nastaven%C3%AD-" +"syst%C3%A9mu-Git#_va%C5%A1e_toto%C5%BEnost" + +#: src/nonemast/window.py:376 +msgid "Error Creating a Commit" +msgstr "" + +#: src/nonemast/window.py:433 +#, python-format +msgid "Could not find a Git remote with URL “%(remote_url)s”." +msgstr "" + +#: src/nonemast/window.ui:29 +msgid "Search" +msgstr "" + +#: src/nonemast/window.ui:36 +msgid "Filter" +msgstr "Filtr" + +#: src/nonemast/window.ui:66 +msgid "Loading commits…" +msgstr "Načítání revizí…" + +#: src/nonemast/window.ui:79 +msgid "Error obtaining commit list." +msgstr "Chyba získávání seznamu revyzí" + +#: src/nonemast/window.ui:179 +msgid "No updates selected." +msgstr "Nevybrány žádné aktualizace" + +#: src/nonemast/window.ui:215 +msgid "Ensure _Co-authors" +msgstr "Vynutit spolu_autorství" + +#: src/nonemast/window.ui:221 +msgid "_Keyboard Shortcuts" +msgstr "_Klávesové zkratky" + +#: src/nonemast/window.ui:225 +msgid "_About Not Nearly Enough Masking Tape" +msgstr "_O programu Nonemast" + +#: src/nonemast/window.ui:233 +msgid "_All" +msgstr "_Vše" + +#: src/nonemast/window.ui:238 +msgid "_Reviewed" +msgstr "Z_kontrolováno" + +#: src/nonemast/window.ui:243 +msgid "_Unreviewed" +msgstr "_Nezkontrolováno" diff --git a/po/meson.build b/po/meson.build index d76dcca..5b62224 100644 --- a/po/meson.build +++ b/po/meson.build @@ -4,4 +4,8 @@ i18n.gettext( 'nonemast', preset: 'glib', + args: [ + '--no-wrap', + '--width=500', + ], ) diff --git a/src/nonemast/main.py b/src/nonemast/main.py index 9006e7a..a5abaf8 100644 --- a/src/nonemast/main.py +++ b/src/nonemast/main.py @@ -3,6 +3,7 @@ import sys +from gettext import gettext as _ from gi.repository import Adw from gi.repository import Ggit from gi.repository import Gio @@ -35,7 +36,7 @@ def do_activate(self, repo_path: Optional[Gio.File] = None) -> None: def do_open(self, files: Sequence[Gio.File], n_files: int, hint: str) -> None: if n_files != 1: - sys.exit("error: nonemast expects exactly one path as an argument.") + sys.exit(_("error: nonemast expects exactly one path as an argument.")) self.do_activate(repo_path=files[0]) @@ -54,12 +55,13 @@ def on_about_action( """Callback for the app.about action.""" about = Adw.AboutWindow( transient_for=self.props.active_window, - application_name="Not Nearly Enough Masking Tape", + application_name=_("Not Nearly Enough Masking Tape"), application_icon="cz.ogion.Nonemast", license_type=Gtk.License.MIT_X11, version=self.version, developers=["Jan Tojnar"], - copyright="© 2022 Jan Tojnar", + translator_credits=_("translator-credits"), + copyright=_("© 2022 Jan Tojnar"), ) about.present() diff --git a/src/nonemast/package_update.py b/src/nonemast/package_update.py index 59a1991..1c54b4d 100644 --- a/src/nonemast/package_update.py +++ b/src/nonemast/package_update.py @@ -1,6 +1,7 @@ # SPDX-FileCopyrightText: 2022 Jan Tojnar # SPDX-License-Identifier: MIT +from gettext import gettext as _, ngettext from gi.repository import Ggit from gi.repository import Gio from gi.repository import GLib @@ -107,11 +108,11 @@ def description(self): ) num_deltas = diff.get_num_deltas() - return ( - f"{num_deltas} delta in diff" - if num_deltas == 1 - else f"{num_deltas} deltas in diff" - ) + return ngettext( + "%(num_deltas)d delta in diff", + "%(num_deltas)d deltas in diff", + num_deltas, + ) % {"num_deltas": num_deltas} return "" @@ -195,7 +196,7 @@ def add_commit(self, commit: Ggit.Commit) -> None: ) url = find_changelog_link(self._message_lines) if url is None: - self.props.changelog_link = "No changelog detected." + self.props.changelog_link = _("No changelog detected.") else: url = try_getting_corresponding_github_link(url) self.props.changelog_link = ( diff --git a/src/nonemast/window.py b/src/nonemast/window.py index 30ce418..f51bc59 100644 --- a/src/nonemast/window.py +++ b/src/nonemast/window.py @@ -52,7 +52,8 @@ def open_commit_message_in_editor(parent: Gtk.Window, path: Path) -> None: def show_error(): make_error_dialog( - parent, "Unable to find a text editor for editing commit messages." + parent, + _("Unable to find a text editor for editing commit messages."), ).show() GLib.idle_add(show_error) @@ -75,7 +76,8 @@ def view_commit_in_vcs_tool( if viewer is None: make_error_dialog( - parent, "Unable to find a tool for viewing Git commits." + parent, + _("Unable to find a tool for viewing Git commits."), ).show() else: subprocess.run(viewer, cwd=repo_path.get_path()) @@ -331,8 +333,19 @@ def make_git_signature(self) -> Optional[Ggit.Signature]: except: make_error_dialog( parent=self, - text="Missing Git Identity", - secondary_text="Please configure Git with your name and e-mail address for commit authorship.", + text=_("Missing Git Identity"), + secondary_text=_( + "Please %(your_identity_link_start)s configure Git with your name and e-mail address %(your_identity_link_end)s for commit authorship." + ) + % { + "your_identity_link_start": "", + "your_identity_link_end": "", + } + % { + "your_identity_url": _( + "https://www.git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup#_your_identity" + ) + }, secondary_use_markup=True, ).show() @@ -360,7 +373,7 @@ def create_empty_commit( except GLib.Error as error: make_error_dialog( parent=self, - text="Error Creating a Commit", + text=_("Error Creating a Commit"), secondary_text=error.message, ).show() @@ -417,7 +430,8 @@ def load_commit_history(self) -> None: nixpkgs_remote_name = find_nixpkgs_remote_name(self._repo) if nixpkgs_remote_name is None: error = GLib.Error( - f"Could not find a Git remote with URL “{NIXPKGS_REMOTE_URL}”.", + _("Could not find a Git remote with URL “%(remote_url)s”.") + % {"remote_url": NIXPKGS_REMOTE_URL}, "nonemast", 1, )