-
Notifications
You must be signed in to change notification settings - Fork 15
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
Pull/push translations to from/to Weblate (Port to RHEL8) #32
Open
M4rtinK
wants to merge
9
commits into
rhinstaller:rhel8-branch
Choose a base branch
from
M4rtinK:rhel8-branch-weblate_migration
base: rhel8-branch
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d6f53d0
Remove pot file
jkonecny12 4caca2a
Download translations from Weblate
jkonecny12 6df0725
Push translations to our translation repository
jkonecny12 532c20e
Remove Zanata
jkonecny12 24d2ba3
Remove unused PREFIX from Makefile
jkonecny12 62af0e1
Pause release when making bumpver to check and solve translations
jkonecny12 daea6bb
Add pot file to the git ignore
jkonecny12 094dd74
Add Readme with description and translation badge
jkonecny12 5511311
Fix make archive command after pot file removal
jkonecny12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ ChangeLog | |
po/*.gmo | ||
po/*.po | ||
po/POTFILES | ||
po/python-meh.pot | ||
|
||
build/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,21 @@ 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 | ||
|
||
PYCHECKEROPTS=--no-argsused --no-miximport --maxargs 0 --no-local -\# 0 --only -Q | ||
|
||
ZANATA_PULL_ARGS = --transdir po/ | ||
ZANATA_PUSH_ARGS = --srcdir po/ --push-type source --force | ||
# LOCALIZATION SETTINGS | ||
L10N_REPOSITORY ?= https://github.com/rhinstaller/python-meh-l10n.git | ||
L10N_REPOSITORY_RW ?= [email protected]: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 | ||
|
||
default: all | ||
|
||
|
@@ -54,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 | ||
|
@@ -76,11 +80,43 @@ 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 | ||
|
||
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 | ||
read -p "Please see the above message. Verify and push localization commit. Press anything to continue." -n 1 -r | ||
|
||
bumpver: potfile | ||
zanata push $(ZANATA_PUSH_ARGS) || ( echo "zanata push failed"; exit 1 ) | ||
@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" ; \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This have to change, otherwise you will get Rawhide translations.