From d6f53d03a021c94d847e6e9c64398eec606f0a38 Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 13 Aug 2020 17:38:49 +0200 Subject: [PATCH 1/9] Remove pot file This is now placed in the translation repository. (cherry picked from commit 0a257c2130e23aecc1d6737bd780947b8fb16b81) Related: rhbz#1836950 --- po/python-meh.pot | 116 ---------------------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 po/python-meh.pot diff --git a/po/python-meh.pot b/po/python-meh.pot deleted file mode 100644 index 97ce44a..0000000 --- a/po/python-meh.pot +++ /dev/null @@ -1,116 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-12-10 20:38+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../meh/handler.py:195 -msgid "" -"Use 'continue' command to quit the debugger and get back to the main menu" -msgstr "" - -#: ../meh/handler.py:211 -msgid "Exit the shell to get back to the main menu" -msgstr "" - -#. short (one-char) answer meaning "yes" -#: ../meh/ui/text.py:75 -msgid "y" -msgstr "" - -#. short (one-char) answer meaning "no" -#: ../meh/ui/text.py:78 -msgid "n" -msgstr "" - -#: ../meh/ui/text.py:145 -msgid "Save exception" -msgstr "" - -#: ../meh/ui/text.py:158 tmp/exception-dialog.glade.h:1 -msgid "An unknown error has occurred" -msgstr "" - -#: ../meh/ui/text.py:161 -msgid "Report Bug" -msgstr "" - -#: ../meh/ui/text.py:162 -msgid "Run shell" -msgstr "" - -#: ../meh/ui/text.py:163 -msgid "Quit" -msgstr "" - -#: ../meh/ui/text.py:168 -msgid "Debug" -msgstr "" - -#: ../meh/ui/text.py:173 -msgid "What do you want to do now?" -msgstr "" - -#: ../meh/ui/text.py:181 -msgid "Please make your choice from above: " -msgstr "" - -#: ../meh/ui/text.py:199 -msgid "Hit ENTER to continue" -msgstr "" - -#: ../meh/ui/text.py:213 -#, python-format -msgid "Are you sure you want to exit? [%(yes)s/%(no)s]" -msgstr "" - -#: ../meh/ui/gui.py:176 -msgid "_Exit" -msgstr "" - -#: tmp/exception-dialog.glade.h:2 -msgid "" -"This program has encountered an unknown error. You may\n" -"report the bug below or quit the program." -msgstr "" - -#: tmp/exception-dialog.glade.h:4 -msgid "_Report Bug" -msgstr "" - -#: tmp/exception-dialog.glade.h:5 -msgid "_Quit" -msgstr "" - -#: tmp/exception-dialog.glade.h:6 -msgid "The output below may help determine the cause of the error:" -msgstr "" - -#: tmp/exception-dialog.glade.h:7 -msgid "'Debug' may take you to tty1." -msgstr "" - -#: tmp/exception-dialog.glade.h:8 -msgid "_Debug" -msgstr "" - -#: tmp/exception-dialog.glade.h:9 -msgid "More _info..." -msgstr "" - -#: tmp/exception-dialog.glade.h:10 -msgid "No additional info available." -msgstr "" From 4caca2a85e29c89e749f4ea2b22e8784e46143dc Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 13 Aug 2020 17:43:03 +0200 Subject: [PATCH 2/9] Download translations from Weblate (cherry picked from commit 5411095d7ed87c4a4b6ea952e97e4636e7ae61df) Related: rhbz#1836950 --- Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 52ce0eb..4012c9a 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,15 @@ TESTSUITE:=tests/baseclass.py PYCHECKEROPTS=--no-argsused --no-miximport --maxargs 0 --no-local -\# 0 --only -Q +# LOCALIZATION SETTINGS +L10N_REPOSITORY ?= https://github.com/rhinstaller/python-meh-l10n.git + +# Branch used in localization repository. This should be master all the time. +GIT_L10N_BRANCH ?= master + +# Directory in localization repository specific for this branch. +L10N_DIR ?= master + ZANATA_PULL_ARGS = --transdir po/ ZANATA_PUSH_ARGS = --srcdir po/ --push-type source --force @@ -76,8 +85,10 @@ potfile: $(MAKE) -C po potfile po-pull: - rpm -q python2-zanata-client &>/dev/null || ( echo "need to run: dnf install zanata-python-client"; exit 1 ) - zanata pull $(ZANATA_PULL_ARGS) + TEMP_DIR=$$(mktemp --tmpdir -d $(PKGNAME)-localization-XXXXXXXXXX) && \ + git clone --depth 1 -b $(GIT_L10N_BRANCH) -- $(L10N_REPOSITORY) $$TEMP_DIR && \ + cp $$TEMP_DIR/$(L10N_DIR)/*.po ./po/ && \ + rm -rf $$TEMP_DIR bumpver: potfile zanata push $(ZANATA_PUSH_ARGS) || ( echo "zanata push failed"; exit 1 ) From 6df0725c1c47764ed7be79b479999265ab65e8ed Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 13 Aug 2020 17:47:23 +0200 Subject: [PATCH 3/9] Push translations to our translation repository Zanata is not used anymore. (cherry picked from commit d48b2e050c925506c77488a5abc7a272f25bfcba) Resolves: rhbz#1836950 --- Makefile | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4012c9a..a6d393f 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ PYCHECKEROPTS=--no-argsused --no-miximport --maxargs 0 --no-local -\# 0 --only - # LOCALIZATION SETTINGS L10N_REPOSITORY ?= https://github.com/rhinstaller/python-meh-l10n.git +L10N_REPOSITORY_RW ?= git@github.com:rhinstaller/python-meh-l10n.git # Branch used in localization repository. This should be master all the time. GIT_L10N_BRANCH ?= master @@ -90,8 +91,36 @@ po-pull: cp $$TEMP_DIR/$(L10N_DIR)/*.po ./po/ && \ rm -rf $$TEMP_DIR -bumpver: potfile - zanata push $(ZANATA_PUSH_ARGS) || ( echo "zanata push failed"; exit 1 ) +po-push: potfile +# This algorithm will make these steps: +# - clone localization repository +# - copy pot file to this repository +# - check if pot file is changed (ignore the POT-Creation-Date otherwise it's always changed) +# - if not changed: +# - remove cloned repository +# - if changed: +# - add pot file +# - commit pot file +# - tell user to verify this file and push to the remote from the temp dir + TEMP_DIR=$$(mktemp --tmpdir -d $(PKGNAME)-localization-XXXXXXXXXX) || exit 1 ; \ + git clone --depth 1 -b $(GIT_L10N_BRANCH) -- $(L10N_REPOSITORY_RW) $$TEMP_DIR || exit 2 ; \ + cp ./po/$(PKGNAME).pot $$TEMP_DIR/$(L10N_DIR)/ || exit 3 ; \ + pushd $$TEMP_DIR/$(L10N_DIR) ; \ + git difftool --trust-exit-code -y -x "diff -u -I '^\"POT-Creation-Date: .*$$'" HEAD ./$(PKGNAME).pot &>/dev/null ; \ + if [ $$? -eq 0 ] ; then \ + popd ; \ + echo "Pot file is up to date" ; \ + rm -rf $$TEMP_DIR ; \ + else \ + git add ./$(PKGNAME).pot && \ + git commit -m "Update $(PKGNAME).pot" && \ + popd && \ + echo "Pot file updated for the localization repository $(L10N_REPOSITORY)" && \ + echo "Please confirm changes and push:" && \ + echo "$$TEMP_DIR" ; \ + fi ; + +bumpver: po-push @NEWSUBVER=$$((`echo $(VERSION) |cut -d . -f 2` + 1)) ; \ NEWVERSION=`echo $(VERSION).$$NEWSUBVER |cut -d . -f 1,3` ; \ DATELINE="* `LANG=c date "+%a %b %d %Y"` `git config user.name` <`git config user.email`> - $$NEWVERSION-1" ; \ From 532c20ee5fb56a27c9d3d84124cc136982c452b8 Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 13 Aug 2020 17:48:39 +0200 Subject: [PATCH 4/9] Remove Zanata It was replaced by Weblate translation platform. (cherry picked from commit ac1ae4e63bfe23da877136332cc75ca4e6709286) Related: rhbz#1836950 --- Makefile | 3 --- zanata.xml | 7 ------- 2 files changed, 10 deletions(-) delete mode 100644 zanata.xml diff --git a/Makefile b/Makefile index a6d393f..b6efdab 100644 --- a/Makefile +++ b/Makefile @@ -21,9 +21,6 @@ GIT_L10N_BRANCH ?= master # Directory in localization repository specific for this branch. L10N_DIR ?= master -ZANATA_PULL_ARGS = --transdir po/ -ZANATA_PUSH_ARGS = --srcdir po/ --push-type source --force - default: all all: diff --git a/zanata.xml b/zanata.xml deleted file mode 100644 index 696e525..0000000 --- a/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org/ - python-meh - rhel-8 - gettext - From 24d2ba3e5e70be5a53c2f2fc22aedca6371d53a3 Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 13 Aug 2020 17:49:19 +0200 Subject: [PATCH 5/9] Remove unused PREFIX from Makefile (cherry picked from commit 0c486b94b729b4944d3a5366b9b0031e61ab7b99) Related: rhbz#1836950 --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index b6efdab..1be2ad2 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,6 @@ VERSION=$(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec) RELEASE=$(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g') TAG=$(PKGNAME)-$(VERSION) -PREFIX=/usr - PYTHON=python3 TESTSUITE:=tests/baseclass.py From 62af0e1dc5c296f2d18c1f34846a3483aaa0f1cd Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 13 Aug 2020 17:50:43 +0200 Subject: [PATCH 6/9] Pause release when making bumpver to check and solve translations This should be removed after pot file creation will be automated. (cherry picked from commit 9d3f42e982193449088385b7913b4710a63319ff) Related: rhbz#1836950 --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 1be2ad2..ad3c311 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,8 @@ po-push: potfile fi ; bumpver: po-push + read -p "Please see the above message. Verify and push localization commit. Press anything to continue." -n 1 -r + @NEWSUBVER=$$((`echo $(VERSION) |cut -d . -f 2` + 1)) ; \ NEWVERSION=`echo $(VERSION).$$NEWSUBVER |cut -d . -f 1,3` ; \ DATELINE="* `LANG=c date "+%a %b %d %Y"` `git config user.name` <`git config user.email`> - $$NEWVERSION-1" ; \ From daea6bb5320ea571503fc21d979c5b49454a2e3a Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 13 Aug 2020 17:51:59 +0200 Subject: [PATCH 7/9] Add pot file to the git ignore Pot file is from now on stored only in the translation repository. (cherry picked from commit 5e615b21006b2b465403b8a08107f2cc3e0109d0) Related: rhbz#1836950 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 60074ed..6b9cc96 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ ChangeLog po/*.gmo po/*.po po/POTFILES +po/python-meh.pot build/ From 094dd74618836099aadbe64b806502f8a01acdf7 Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 13 Aug 2020 17:55:09 +0200 Subject: [PATCH 8/9] Add Readme with description and translation badge (cherry picked from commit 7cc7fe474118b446cb0c1095589a6c86682c6381) Related: rhbz#1836950 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9b0d407 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +[![Translation status](https://translate.fedoraproject.org/widgets/python-meh/-/rhel-8/svg-badge.svg)](https://translate.fedoraproject.org/engage/python-meh/?utm_source=widget) + +Python Meh +========== + +The python-meh package is a python library for handling, saving, and reporting exceptions. From 5511311565272cbb840fff3a28c86158c638dc94 Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Thu, 20 Aug 2020 16:32:44 +0200 Subject: [PATCH 9/9] Fix make archive command after pot file removal Pot file was moved to a separate repository, however, this command wasn't changed appropriately. Fix this now. (cherry picked from commit fd72a88c0553190b88968bbe6169aa2106009f6b) Related: rhbz#1836950 --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index ad3c311..e263c0d 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,6 @@ archive: po-pull tar -rf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION) gzip -9 $(PKGNAME)-$(VERSION).tar rm -rf $(PKGNAME)-$(VERSION) - git checkout -- po/$(PKGNAME).pot @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz" local: po-pull