Skip to content

Commit

Permalink
Rely on builtin meson targets for i10n
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Aug 12, 2021
1 parent 63b77e4 commit 8841d72
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ indent_size = 2

[{Makefile,**.mk}]
indent_style = tab

[LINGUAS]
insert_final_newline = false
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,3 @@ test:

clean:
rm -rf build install .eslintcache

update-locales:
xgettext -f po/POTFILES -o po/re.sonny.Commit.pot --no-wrap -cTRANSLATORS --from-code=UTF-8
sed -i "s/Project-Id-Version: PACKAGE VERSION/Project-Id-Version: re.sonny.Commit/" po/re.sonny.Commit.pot
msgmerge -U po/*.po po/re.sonny.Commit.pot
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,19 @@ Flathub builds https://flathub.org/builds/#/apps/re.sonny.Commit

```sh
# To update the pot file
xgettext -f po/POTFILES -o po/re.sonny.Commit.pot --no-wrap -cTRANSLATORS --from-code=UTF-8
sed -i "s/Project-Id-Version: PACKAGE VERSION/Project-Id-Version: re.sonny.Commit/" po/re.sonny.Commit.pot
# xgettext -f po/POTFILES -o po/re.sonny.Commit.pot --no-wrap -cTRANSLATORS --from-code=UTF-8
# sed -i "s/Project-Id-Version: PACKAGE VERSION/Project-Id-Version: re.sonny.Commit/" po/re.sonny.Commit.pot
meson compile re.sonny.Commit-pot -C _build


# To create a translation
msginit -i po/re.sonny.Commit.pot -o po/fr.po -l fr_FR.UTF-8
# msginit -i po/re.sonny.Commit.pot -o po/fr.po -l fr_FR.UTF-8
echo -n " fr" >> po/LINGUAS
meson compile re.sonny.Commit-update-po -C _build

# To update translations
msgmerge -U po/*.po po/re.sonny.Commit.pot
# msgmerge -U po/*.po po/re.sonny.Commit.pot
meson compile re.sonny.Commit-update-po -C _build
```

See https://github.com/sonnyp/Commit/pull/14#issuecomment-894070878
Expand All @@ -109,7 +114,7 @@ See https://github.com/sonnyp/Commit/pull/14#issuecomment-894070878

<summary>Publish new version</summary>

- `make update-locales`
- `meson compile re.sonny.Commit-update-po -C _build`
- Update version in `meson.build`
- git tag
- flathub
Expand Down
2 changes: 1 addition & 1 deletion po/LINGUAS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cs
cs
14 changes: 7 additions & 7 deletions po/cs.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Czech translations for Commit package.
# Copyright (C) 2021 THE Commit'S COPYRIGHT HOLDER
# This file is distributed under the same license as the Commit package.
# Czech translations for re.sonny.Commit package.
# Copyright (C) 2021 THE re.sonny.Commit'S COPYRIGHT HOLDER
# This file is distributed under the same license as the re.sonny.Commit package.
# Vojtěch Perník <[email protected]>, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: Commit\n"
"Project-Id-Version: re.sonny.Commit\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-08-11 13:02+0200\n"
"POT-Creation-Date: 2021-08-12 13:08+0200\n"
"PO-Revision-Date: 2021-08-11 13:42+0200\n"
"Last-Translator: Vojtěch Perník <[email protected]>\n"
"Language-Team: Czech <[email protected]>\n"
Expand Down Expand Up @@ -173,8 +173,8 @@ msgstr "Správné rozpoznání cesty ke spustitelnému souboru"
msgid "Message title length hint"
msgstr "Zvýraznění překročení délky titulku"

#. TRANSLATORS: eg. 'Translator Name <[email protected]>' or 'Translator Name <https://website.example>'
#: src/about.js:19
#. TRANSLATORS: eg. 'Translator Name <[email protected]>' or 'Translator Name https://website.example'
#: src/about.js:18
msgid "translator-credits"
msgstr "Vojtěch Perník <[email protected]>"

Expand Down
41 changes: 28 additions & 13 deletions po/re.sonny.Commit.pot
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# This file is distributed under the same license as the re.sonny.Commit package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: re.sonny.Commit\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-08-11 13:02+0200\n"
"POT-Creation-Date: 2021-08-12 13:08+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -33,19 +33,24 @@ msgid "git;mercurial;hg;scm;"
msgstr ""

#: data/re.sonny.Commit.appdata.xml:12
msgid "Commit is an editor that helps you write better Git and Mercurial commit messages."
msgid ""
"Commit is an editor that helps you write better Git and Mercurial commit "
"messages."
msgstr ""

#: data/re.sonny.Commit.appdata.xml:16
msgid "After installing make sure to launch the application and follow the instructions."
msgid ""
"After installing make sure to launch the application and follow the "
"instructions."
msgstr ""

#: data/re.sonny.Commit.appdata.xml:20
msgid "Features:"
msgstr ""

#: data/re.sonny.Commit.appdata.xml:22
msgid "Highlights overflow of title when it exceeds 50 characters (customizable)"
msgid ""
"Highlights overflow of title when it exceeds 50 characters (customizable)"
msgstr ""

#: data/re.sonny.Commit.appdata.xml:26
Expand All @@ -65,11 +70,15 @@ msgid "Displays project folder and branch in window header"
msgstr ""

#: data/re.sonny.Commit.appdata.xml:30
msgid "Dark theme support: the overflow highlight is adjusted according to your theme"
msgid ""
"Dark theme support: the overflow highlight is adjusted according to your "
"theme"
msgstr ""

#: data/re.sonny.Commit.appdata.xml:34
msgid "Supports git commit messages, merge messages, tag messages, add -p messages, and rebase -i messages"
msgid ""
"Supports git commit messages, merge messages, tag messages, add -p messages, "
"and rebase -i messages"
msgstr ""

#: data/re.sonny.Commit.appdata.xml:38
Expand Down Expand Up @@ -121,7 +130,9 @@ msgid "Add 6px margin to editor"
msgstr ""

#: data/re.sonny.Commit.appdata.xml:86
msgid "⚠️ Action required. After updating, please launch the application and follow the instructions."
msgid ""
"⚠️ Action required. After updating, please launch the application and follow "
"the instructions."
msgstr ""

#: data/re.sonny.Commit.appdata.xml:91
Expand Down Expand Up @@ -153,8 +164,8 @@ msgstr ""
msgid "Message title length hint"
msgstr ""

#. TRANSLATORS: eg. 'Translator Name <[email protected]>' or 'Translator Name <https://website.example>'
#: src/about.js:19
#. TRANSLATORS: eg. 'Translator Name <[email protected]>' or 'Translator Name https://website.example'
#: src/about.js:18
msgid "translator-credits"
msgstr ""

Expand All @@ -167,7 +178,8 @@ msgid "Preferences"
msgstr ""

#: src/welcome.ui:58
msgid "To set Commit as default editor for Git run the following command in Terminal"
msgid ""
"To set Commit as default editor for Git run the following command in Terminal"
msgstr ""

#: src/welcome.ui:90 src/welcome.ui:172
Expand All @@ -179,12 +191,15 @@ msgid "Documentation"
msgstr ""

#: src/welcome.ui:108
msgid "https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_editor"
msgid ""
"https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_editor"
msgstr ""

#. TRANSLATORS: Don't translate <tt>hgrc</tt>
#: src/welcome.ui:139
msgid "To set Commit as default editor for Mercurial, set the following in your <tt>hgrc</tt>"
msgid ""
"To set Commit as default editor for Mercurial, set the following in your "
"<tt>hgrc</tt>"
msgstr ""

#: src/welcome.ui:185
Expand Down
9 changes: 4 additions & 5 deletions src/about.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import Gtk from "gi://Gtk";
import { gettext as _ } from 'gettext';
import { gettext as _ } from "gettext";

export default function About({ application, version }) {
// https://gjs-docs.gnome.org/gtk30~3.24.8/gtk.aboutdialog
const dialog = new Gtk.AboutDialog({
application,
authors: ["Sonny Piers https://sonny.re", "Aral Balkan https://ar.al/"],
comments: _("Commit message editor"),
copyright:
"© 2020-2021 Sonny Piers\n© 2018-2020 Aral balkan",
copyright: "© 2020-2021 Sonny Piers\n© 2018-2020 Aral balkan",
license_type: Gtk.License.GPL_3_0,
version,
website: "https://github.com/sonnyp/Commit",
transient_for: application.get_active_window(),
modal: true,
logo_icon_name: "re.sonny.Commit",
// TRANSLATORS: eg. 'Translator Name <[email protected]>' or 'Translator Name <https://website.example>'
translator_credits: _('translator-credits')
// TRANSLATORS: eg. 'Translator Name <[email protected]>' or 'Translator Name https://website.example'
translator_credits: _("translator-credits"),
});
dialog.add_credit_section("Contributors", [
// Add yourself as
Expand Down

0 comments on commit 8841d72

Please sign in to comment.