Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translation fixes #21

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cs
1 change: 0 additions & 1 deletion po/POTFILES
Original file line number Diff line number Diff line change
@@ -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
Expand Down
157 changes: 157 additions & 0 deletions po/cs.po
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions po/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
i18n.gettext(
'nonemast',
preset: 'glib',
args: [
'--no-wrap',
'--width=500',
],
)
8 changes: 5 additions & 3 deletions src/nonemast/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])

Expand All @@ -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()

Expand Down
13 changes: 7 additions & 6 deletions src/nonemast/package_update.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 = (
Expand Down
26 changes: 20 additions & 6 deletions src/nonemast/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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())
Expand Down Expand Up @@ -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 <a href='https://www.git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup#_your_identity'>configure Git with your name and e-mail address</a> 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": "<a href='%(your_identity_url)s'>",
"your_identity_link_end": "</a>",
}
% {
"your_identity_url": _(
"https://www.git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup#_your_identity"
)
},
secondary_use_markup=True,
).show()

Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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,
)
Expand Down