Skip to content

Commit

Permalink
refactor(update-desktop-files): use "locale/$LANG/LC_MESSAGES/message…
Browse files Browse the repository at this point in the history
…s.po" structure
  • Loading branch information
cfm committed Oct 6, 2023
1 parent 986fa63 commit 6ffacc4
Show file tree
Hide file tree
Showing 25 changed files with 59 additions and 78 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ coverage.xml
.hypothesis/
.mypy_cache/

# Translations compiled during packaging:
# Translation artifacts generated during testing and packaging:
install_files/ansible-base/roles/tails-config/templates/locale/*.po
securedrop/tests/i18n/messages.pot
securedrop/translations/**/*.mo

# Flask stuff:
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ POT=${LOCALE_DIR}/messages.pot

DESKTOP_BASE=install_files/ansible-base/roles/tails-config/templates
DESKTOP_LOCALE_DIR=$(DESKTOP_BASE)/locale
DESKTOP_I18N_CONF=$(DESKTOP_BASE)/LINGUAS
DESKTOP_I18N_CONF=$(DESKTOP_LOCALE_DIR)/LINGUAS
DESKTOP_POT=$(DESKTOP_LOCALE_DIR)/messages.pot

.PHONY: check-strings
Expand Down Expand Up @@ -402,9 +402,19 @@ $(DESKTOP_POT): ${DESKTOP_BASE}/*.in
$^
@sed -i -e '/^"POT-Creation-Date/d' $@

# Render desktop files from templates.
# Render desktop files from templates. msgfmt needs each
# "$LANG/LC_MESSAGES/messages.po" file in "$LANG.po".
%.j2: %.j2.in
@msgfmt -d ${DESKTOP_BASE} --desktop --template $< --output-file $@
@find ${DESKTOP_LOCALE_DIR}/* \
-maxdepth 0 \
-type d \
-exec bash -c 'locale="$$(basename {})"; cp ${DESKTOP_LOCALE_DIR}/$${locale}/LC_MESSAGES/messages.po $(DESKTOP_LOCALE_DIR)/$${locale}.po' \;
@msgfmt \
-d ${DESKTOP_LOCALE_DIR} \
--desktop \
--template $< \
--output-file $@
@rm ${DESKTOP_LOCALE_DIR}/*.po

# Render desktop list from "i18n.json".
$(DESKTOP_I18N_CONF):
Expand Down Expand Up @@ -453,19 +463,9 @@ endif

.PHONY: verify-mo
verify-mo: ## Verify that all gettext machine objects (.mo) are reproducible from their catalogs (.po).
@# TODO(#6917): Once Weblate (rather than i18n_tool.py) is correctly filing
@# both .po and .mo under $DESKTOP_LOCALE_DIR, remove this step. (See
@# also: 76f3adeed90f4aaadbf0685e09dec6314367d5c0.)
@find ${DESKTOP_BASE} \
-maxdepth 1 \
-name "*.po" \
-exec bash -c 'PO="$$(basename {} | sed \'s/.po//')"; cp ${DESKTOP_BASE}/$${PO}.po $(DESKTOP_LOCALE_DIR)/$${PO}/LC_MESSAGES/messages.po' \;
@TERM=dumb devops/scripts/verify-mo.py ${DESKTOP_LOCALE_DIR}/*
@# All good; now clean up.
@# TODO(#6917): git restore "${LOCALE_DIR}/**/*.po"
@find ${DESKTOP_LOCALE_DIR} \
-name "*.po" \
-delete
@git restore "${LOCALE_DIR}/**/*.po"


###########
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2018-06-30 10:57+0000\n"
"Last-Translator: erinm <[email protected]>\n"
"Language-Team: Arabic <https://weblate.securedrop.org/projects/securedrop/"
"desktop/ar/>\n"
"Language-Team: Arabic <https://weblate.securedrop.org/projects/securedrop/desktop/ar/>\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"X-Generator: Weblate 2.20\n"

msgid "Launch Source Interface"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-14 13:56+0000\n"
"Last-Translator: John Smith <[email protected]>\n"
"Language-Team: Catalan <https://weblate.securedrop.org/projects/securedrop/"
"desktop/ca/>\n"
"Language-Team: Catalan <https://weblate.securedrop.org/projects/securedrop/desktop/ca/>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-21 06:56+0000\n"
"Last-Translator: Jan Papež <[email protected]>\n"
"Language-Team: Czech <https://weblate.securedrop.org/projects/securedrop/"
"desktop/cs/>\n"
"Language-Team: Czech <https://weblate.securedrop.org/projects/securedrop/desktop/cs/>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-18 10:56+0000\n"
"Last-Translator: Curtis Baltimore <[email protected]>\n"
"Language-Team: German <https://weblate.securedrop.org/projects/securedrop/"
"desktop/de/>\n"
"Language-Team: German <https://weblate.securedrop.org/projects/securedrop/desktop/de/>\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2018-08-22 11:02+0000\n"
"Last-Translator: Adrian <[email protected]>\n"
"Language-Team: Greek <https://weblate.securedrop.org/projects/securedrop/"
"desktop/el/>\n"
"Language-Team: Greek <https://weblate.securedrop.org/projects/securedrop/desktop/el/>\n"
"Language: el\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2018-12-05 08:18+0000\n"
"Last-Translator: Adolfo Jayme-Barrientos <[email protected]>\n"
"Language-Team: Spanish <https://weblate.securedrop.org/projects/securedrop/"
"desktop/es/>\n"
"Language-Team: Spanish <https://weblate.securedrop.org/projects/securedrop/desktop/es/>\n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-09-04 16:26+0200\n"
"PO-Revision-Date: 2023-06-13 16:56+0000\n"
"Last-Translator: AO Localization Lab <[email protected]>\n"
"Language-Team: French <https://weblate.securedrop.org/projects/securedrop/"
"desktop/fr/>\n"
"Language-Team: French <https://weblate.securedrop.org/projects/securedrop/desktop/fr/>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2018-03-08 13:50+0000\n"
"Last-Translator: Muhammad Usman <[email protected]>\n"
"Language-Team: Hindi <https://weblate.securedrop.org/projects/securedrop/"
"desktop/hi/>\n"
"Language-Team: Hindi <https://weblate.securedrop.org/projects/securedrop/desktop/hi/>\n"
"Language: hi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-13 09:56+0000\n"
"Last-Translator: Sveinn í Felli <[email protected]>\n"
"Language-Team: Icelandic <https://weblate.securedrop.org/projects/securedrop/"
"desktop/is/>\n"
"Language-Team: Icelandic <https://weblate.securedrop.org/projects/securedrop/desktop/is/>\n"
"Language: is\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2018-01-13 08:54+0000\n"
"Last-Translator: Claudio Arseni <[email protected]>\n"
"Language-Team: Italian <https://weblate.securedrop.org/projects/securedrop/"
"desktop/it/>\n"
"Language-Team: Italian <https://weblate.securedrop.org/projects/securedrop/desktop/it/>\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Freedom of the Press Foundation
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# Translations template for SecureDrop.
# Copyright (C) 2023 Freedom of the Press Foundation
# This file is distributed under the same license as the SecureDrop project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: SecureDrop 2.7.0~rc1\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"

#. Name
msgid "SecureDrop Journalist Interface"
msgstr ""

#. Icon
msgid "{{ tails_config_securedrop_dotfiles }}/securedrop_icon.png"
msgstr ""

#. Name
msgid "SecureDrop Source Interface"
msgstr ""

msgid "Launch Source Interface"
msgstr ""
Expand All @@ -37,10 +49,3 @@ msgstr ""
msgid "Open File Browser"
msgstr ""

#: desktop-journalist-icon.j2.in:10
msgid "SecureDrop Journalist Interface"
msgstr ""

#: desktop-source-icon.j2.in:10
msgid "SecureDrop Source Interface"
msgstr ""
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-09-04 16:26+0200\n"
"PO-Revision-Date: 2023-06-20 22:56+0000\n"
"Last-Translator: Øyvind Bye Skille <[email protected]>\n"
"Language-Team: Norwegian Bokmål <https://weblate.securedrop.org/projects/"
"securedrop/desktop/nb_NO/>\n"
"Language-Team: Norwegian Bokmål <https://weblate.securedrop.org/projects/securedrop/desktop/nb_NO/>\n"
"Language: nb_NO\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2017-12-01 13:48+0000\n"
"Last-Translator: kwadronaut <[email protected]>\n"
"Language-Team: Dutch <https://weblate.securedrop.org/projects/securedrop/"
"desktop/nl/>\n"
"Language-Team: Dutch <https://weblate.securedrop.org/projects/securedrop/desktop/nl/>\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-22 07:39+0000\n"
"Last-Translator: notmuchtohide <[email protected]>\n"
"Language-Team: Portuguese (Brazil) <https://weblate.securedrop.org/projects/"
"securedrop/desktop/pt_BR/>\n"
"Language-Team: Portuguese (Brazil) <https://weblate.securedrop.org/projects/securedrop/desktop/pt_BR/>\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-22 08:56+0000\n"
"Last-Translator: deeplow <[email protected]>\n"
"Language-Team: Portuguese (Portugal) <https://weblate.securedrop.org/"
"projects/securedrop/desktop/pt_PT/>\n"
"Language-Team: Portuguese (Portugal) <https://weblate.securedrop.org/projects/securedrop/desktop/pt_PT/>\n"
"Language: pt_PT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2018-03-11 16:05+0000\n"
"Last-Translator: Jobava <[email protected]>\n"
"Language-Team: Romanian <https://weblate.securedrop.org/projects/securedrop/"
"desktop/ro/>\n"
"Language-Team: Romanian <https://weblate.securedrop.org/projects/securedrop/desktop/ro/>\n"
"Language: ro\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==0 || (n%100 > 0 && n%100 < "
"20)) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;\n"
"X-Generator: Weblate 2.18\n"

msgid "Launch Source Interface"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-20 19:56+0000\n"
"Last-Translator: Adham Kurbanov <[email protected]>\n"
"Language-Team: Russian <https://weblate.securedrop.org/projects/securedrop/"
"desktop/ru/>\n"
"Language-Team: Russian <https://weblate.securedrop.org/projects/securedrop/desktop/ru/>\n"
"Language: ru\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%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.14.1\n"

msgid "Launch Source Interface"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2019-08-29 21:39+0000\n"
"Last-Translator: 1000101 <[email protected]>\n"
"Language-Team: Slovak <https://weblate.securedrop.org/projects/securedrop/"
"desktop/sk/>\n"
"Language-Team: Slovak <https://weblate.securedrop.org/projects/securedrop/desktop/sk/>\n"
"Language: sk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-13 07:56+0000\n"
"Last-Translator: Jonas Waga <[email protected]>\n"
"Language-Team: Swedish <https://weblate.securedrop.org/projects/securedrop/"
"desktop/sv/>\n"
"Language-Team: Swedish <https://weblate.securedrop.org/projects/securedrop/desktop/sv/>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2018-01-11 15:26+0000\n"
"Last-Translator: Volkan <[email protected]>\n"
"Language-Team: Turkish <https://weblate.securedrop.org/projects/securedrop/"
"desktop/tr/>\n"
"Language-Team: Turkish <https://weblate.securedrop.org/projects/securedrop/desktop/tr/>\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-15 04:56+0000\n"
"Last-Translator: Kishin Sagume <[email protected]>\n"
"Language-Team: Chinese (Simplified) <https://weblate.securedrop.org/projects/"
"securedrop/desktop/zh_Hans/>\n"
"Language-Team: Chinese (Simplified) <https://weblate.securedrop.org/projects/securedrop/desktop/zh_Hans/>\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"PO-Revision-Date: 2023-06-15 01:56+0000\n"
"Last-Translator: Chi-Hsun Tsai <[email protected]>\n"
"Language-Team: Chinese (Traditional) <https://weblate.securedrop.org/"
"projects/securedrop/desktop/zh_Hant/>\n"
"Language-Team: Chinese (Traditional) <https://weblate.securedrop.org/projects/securedrop/desktop/zh_Hant/>\n"
"Language: zh_Hant\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down

0 comments on commit 6ffacc4

Please sign in to comment.