From 9b85f2cf5676468bb4783d52a64785a5089be787 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Jan 15 2020 19:53:10 +0000 Subject: [PATCH 1/5] replace Zanata pull/push by translation repository --- diff --git a/Makefile.in b/Makefile.in index 7fc44e0..41baf53 100644 --- a/Makefile.in +++ b/Makefile.in @@ -10,6 +10,8 @@ PYBABEL = $(PYTHON) /usr/bin/pybabel BASEPATH = / PWD = $(shell pwd) POT_FILE := $(shell ls po/*.pot) +TRANS_TMP := $(shell mktemp -d) +TRANS_FOLDER := $(basename $(notdir $(POT_FILE))) BUILDDIR = $(PWD)/../build.d HTTPDDIR = $(PWD)/../httpd @@ -48,10 +50,19 @@ data/templates/translations.html: po/LINGUAS msgmerge: $(wildcard po/*.po) pushpot: - zanata push $(subst po/,,$(POT_FILE)) + git clone ssh://git@pagure.io/fedora-web/translations.git $(TRANS_TMP) + cp $(POT_FILE) $(TRANS_TMP)/$(TRANS_FOLDER)/ + cd $(TRANS_TMP) && git add *.pot + cd $(TRANS_TMP) && git commit -m "update pot file for $(TRANS_FOLDER)" + cd $(TRANS_TMP) && git push + rm -rf $(TRANS_TMP) pullpos: - zanata pull --no-copytrans + git clone ssh://git@pagure.io/fedora-web/translations.git $(TRANS_TMP) + ls -lah $(TRANS_TMP) + cp -R $(TRANS_TMP)/$(TRANS_FOLDER)/*.po ./po/ + cp -R $(TRANS_TMP)/$(TRANS_FOLDER)/LINGUAS ./po/ + rm -rf $(TRANS_TMP) # Use fedfind to grep all releases for the releases.json file, used by FMW # Use this instruction only for getfedora.org From ff05cd4563b5d3526e099bd4c8c7945b5fb49f3a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Jan 15 2020 19:53:10 +0000 Subject: [PATCH 2/5] remove zanata xml files --- diff --git a/alt.fedoraproject.org/zanata.xml b/alt.fedoraproject.org/zanata.xml deleted file mode 100644 index 3dfaf95..0000000 --- a/alt.fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org - fedora-web - alt.fedoraproject.org - gettext - diff --git a/arm.fedoraproject.org/zanata.xml b/arm.fedoraproject.org/zanata.xml deleted file mode 100644 index 0b83d28..0000000 --- a/arm.fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org/ - fedora-web - arm.fedoraproject.org - gettext - diff --git a/boot.fedoraproject.org/zanata.xml b/boot.fedoraproject.org/zanata.xml deleted file mode 100644 index a492426..0000000 --- a/boot.fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org - fedora-web - boot.fedoraproject.org - gettext - diff --git a/budget.fedoraproject.org/zanata.xml b/budget.fedoraproject.org/zanata.xml deleted file mode 100644 index 8919be4..0000000 --- a/budget.fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org/ - fedora-web - budget.fedoraproject.org - gettext - diff --git a/fedoracommunity.org/zanata.xml b/fedoracommunity.org/zanata.xml deleted file mode 100644 index 50fcde1..0000000 --- a/fedoracommunity.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org - fedora-web - fedoracommunity.org - gettext - diff --git a/fedorahosted.org/zanata.xml b/fedorahosted.org/zanata.xml deleted file mode 100644 index fd8df2f..0000000 --- a/fedorahosted.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org - fedora-web - fedorahosted.org - gettext - diff --git a/fedoraproject.org/zanata.xml b/fedoraproject.org/zanata.xml deleted file mode 100644 index d47054a..0000000 --- a/fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org - fedora-web - fedoraproject.org - gettext - diff --git a/flocktofedora.org/zanata.xml b/flocktofedora.org/zanata.xml deleted file mode 100644 index 928688e..0000000 --- a/flocktofedora.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org/ - fedora-web - flocktofedora.org - gettext - diff --git a/getfedora.org/zanata.xml b/getfedora.org/zanata.xml deleted file mode 100644 index 6729ed9..0000000 --- a/getfedora.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org - fedora-web - getfedora.org - gettext - diff --git a/iot.fedoraproject.org/zanata.xml b/iot.fedoraproject.org/zanata.xml deleted file mode 100644 index 754b4b0..0000000 --- a/iot.fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org/ - fedora-web - iot.fedoraproject.org - gettext - diff --git a/labs.fedoraproject.org/zanata.xml b/labs.fedoraproject.org/zanata.xml deleted file mode 100644 index 790c0de..0000000 --- a/labs.fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org/ - fedora-web - labs.fedoraproject.org - gettext - diff --git a/spins.fedoraproject.org/zanata.xml b/spins.fedoraproject.org/zanata.xml deleted file mode 100644 index bdc43ba..0000000 --- a/spins.fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org - fedora-web - spins.fedoraproject.org - gettext - diff --git a/start.fedoraproject.org/zanata.xml b/start.fedoraproject.org/zanata.xml deleted file mode 100644 index ff8cf95..0000000 --- a/start.fedoraproject.org/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org - fedora-web - start.fedoraproject.org - gettext - From 04c099439f5d99934283cfce718819914c8f1ad1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Jan 15 2020 19:53:10 +0000 Subject: [PATCH 3/5] we are not using Zanata anymore --- diff --git a/README.md b/README.md index 3c04a66..710c09f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,10 @@ can easily file Pull Requests. Fork this repository, make your changes and submit them here. Check of the [Fedora Websites wiki](https://fedoraproject.org/wiki/Websites#Join_the_Websites_Team) for details on how to become a member of the websites team. -Translations are handled by the Fedora [localization team](https://fedoraproject.org/wiki/L10N) on [Zanata](https://fedora.zanata.org/project/view/fedora-web). +Translations are handled by the Fedora [localization team](https://fedoraproject.org/wiki/L10N) on [Fedora Weblate](https://translate.stg.fedoraproject.org/projects/fedora-websites/). + +[![Translation status](https://translate.stg.fedoraproject.org/widgets/abrt/-/287x66-white.png)](https://translate.stg.fedoraproject.org/engage/abrt/?utm_source=widget) + ### Websites This repository contains the sources for the following Fedora Websites: diff --git a/docs/source/websites_release.rst b/docs/source/websites_release.rst index 8b5e7e8..a4b00f8 100644 --- a/docs/source/websites_release.rst +++ b/docs/source/websites_release.rst @@ -145,8 +145,8 @@ Update website for Alpha release * Update Alpha Image sizes and pre_cloud_composedate in ``./build.d/globalvar.py``. Verify they are right in Cloud images and Docker image. -* Update the new POT files and push them to Zanata (ask a maintainer to do - so) every time you change text strings. +* Update the new POT files and push them to translation repository every time + you change text strings. * Add this build to stg.fedoraproject.org (ansible syncStatic.sh.stg) to test the pages online. @@ -222,8 +222,8 @@ Update website for Beta release * Update Beta Image sizes and pre_cloud_composedate in ``./build.d/globalvar.py``. Verify they are right in Cloud images and Docker image. -* Update the new POT files and push them to Zanata (ask a maintainer to do - so) every time you change text strings. +* Update the new POT files and push them to translation repository every time + you change text strings. * Add this build to stg.fedoraproject.org (ansible syncStatic.sh.stg) to test the pages online. @@ -298,8 +298,8 @@ Update website for GA * Update static/js/checksum.js and check if the paths and checksum still match. -* Update the new POT files and push them to Zanata (ask a maintainer to do - so) every time you change text strings. +* Update the new POT files and push them to translation repository every time + you change text strings. * Add this build to stg.fedoraproject.org (ansible syncStatic.sh.stg) to test the pages online. @@ -351,4 +351,4 @@ Tips $ git merge f23-beta $ git checkout --theirs f23-beta [list of conflicting po files] - $ git commit \ No newline at end of file + $ git commit diff --git a/tools/l10N_update.sh b/tools/l10N_update.sh index 08738fd..570694f 100755 --- a/tools/l10N_update.sh +++ b/tools/l10N_update.sh @@ -1,5 +1,5 @@ #!/bin/bash -# this script pull all translations to transifex, +# this script pull all translations to tranlation repository, # make an new POT and push it if asked, # and then fill the LINGUAS file @@ -20,7 +20,7 @@ cat << EOF usage: $0 [OPTIONS] [-w WEBSITE_PATH] This script update all L10n things. Will never git push. - * pull translations from transifex against WEBSITE_PATH in current branch + * pull translations from translation repository against WEBSITE_PATH in current branch * make new POT in WEBSITE_PATH * update the LINGUAS file in WEBSITE_PATH @@ -28,7 +28,7 @@ OPTIONS: -h Show this message -a Git add all -c With -a, git commit with default message (POs, POT and LINGUAS in different commits) - -p With -c make pushpot (update POT on transifex.net) + -p With -c make pushpot (update POT on tranlation repository) WEBSITE: The website targeted (like "fedoraproject.org") @@ -39,8 +39,8 @@ EXAMPLES: $ $0 -a -w ../spins.fedoraproject.org (2) $ $0 -a -c -p (3) - 1. Update all but let you git add and push to transifex.net. (Takes time but let you do the job). - 2. Update POs POT and LINGUAS of spins.fedoraproject.org website. Let you commit and push (git/transifex). + 1. Update all but let you git add and push to tranlation repository. + 2. Update POs POT and LINGUAS of spins.fedoraproject.org website. Let you test localy. 3. Update all and commit changes in 3 different commits. That's what you were looking for. EOF @@ -60,7 +60,7 @@ do COMMIT=1 ;; p) - TXN_PUSH=1 + POT_PUSH=1 ;; w) WEBSITE=$OPTARG @@ -124,7 +124,7 @@ do if [ ! -z $ADD ] then git add po/*.pot - if [ ! -z $TXN_PUSH ] && [ ! -z $COMMIT ] + if [ ! -z $POT_PUSH ] && [ ! -z $COMMIT ] then make pushpot fi From 5d4cf8f3c7544d384dd7ce00b348ee6dbbdc555f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Jan 15 2020 19:53:10 +0000 Subject: [PATCH 4/5] remove useless ls --- diff --git a/Makefile.in b/Makefile.in index 41baf53..ff0de2e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -59,7 +59,6 @@ pushpot: pullpos: git clone ssh://git@pagure.io/fedora-web/translations.git $(TRANS_TMP) - ls -lah $(TRANS_TMP) cp -R $(TRANS_TMP)/$(TRANS_FOLDER)/*.po ./po/ cp -R $(TRANS_TMP)/$(TRANS_FOLDER)/LINGUAS ./po/ rm -rf $(TRANS_TMP) From 3c157dda32cd3c55d86d6995d44284f3a9d0a985 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Jan 15 2020 19:53:10 +0000 Subject: [PATCH 5/5] simplify the l10n generation --- diff --git a/tools/l10N_update.sh b/tools/l10N_update.sh index 570694f..3ac2cbd 100755 --- a/tools/l10N_update.sh +++ b/tools/l10N_update.sh @@ -26,22 +26,20 @@ This script update all L10n things. Will never git push. OPTIONS: -h Show this message - -a Git add all - -c With -a, git commit with default message (POs, POT and LINGUAS in different commits) - -p With -c make pushpot (update POT on tranlation repository) + -p update POT on tranlation repository WEBSITE: The website targeted (like "fedoraproject.org") Without WEBSITE specifyed, will parse the whole website array. EXAMPLES: - $ $0 (1) - $ $0 -a -w ../spins.fedoraproject.org (2) - $ $0 -a -c -p (3) + $ $0 (1) + $ $0 -w ../spins.fedoraproject.org (2) + $ $0 -p (3) 1. Update all but let you git add and push to tranlation repository. - 2. Update POs POT and LINGUAS of spins.fedoraproject.org website. Let you test localy. - 3. Update all and commit changes in 3 different commits. That's what you were looking for. + 2. Pull POs + LINGUAS, generate pot of spins.fedoraproject.org website. Let you test localy. + 3. Pull POs + LINGUAS, generate pot and push it to tranlation repository. That's what you were looking for. EOF } @@ -53,12 +51,6 @@ do usage exit 1 ;; - a) - ADD=1 - ;; - c) - COMMIT=1 - ;; p) POT_PUSH=1 ;; @@ -95,19 +87,9 @@ for i in "${site[@]}" do cd $i make pullpos - if [ ! -z $ADD ] - then - git add po/*.po - fi cd $root done -if [ ! -z $COMMIT ] && [ ! -z $ADD ] -then - git commit -m "[`basename $0`] Full POs update" -fi - - ### POT for i in "${site[@]}" @@ -115,81 +97,19 @@ do echo "- Updating $i POT" cd $i make pot - insertion_number=`git diff --numstat po/*.pot 2>&1 | awk '{print $1}'` # record the number of insertion, - #if no new string found at least the build time could change (i.e. check if > 1) - let "$((++insertion_number))" # cause in case the file is exactly the same, prevent no git diff output - if [ $insertion_number -gt 2 ] - then # POT should be uploaded - NEED_COMMIT=1 # don't commit if any POT modified! - if [ ! -z $ADD ] - then - git add po/*.pot - if [ ! -z $POT_PUSH ] && [ ! -z $COMMIT ] - then - make pushpot - fi - fi + + # POT should be uploaded + if [ ! -z $POT_PUSH ] + then + make pushpot echo "POT updated" - else - git checkout -- po/*.pot # no real change, undo (only the build time was changed) fi + cd $root done -if [ ! -z $NEED_COMMIT ] && [ ! -z $COMMIT ] && [ ! -z $ADD ] -then - git commit -m "[`basename $0`] Full POT update" -fi - ### LINGUAS -# update the LINGUAS file by adding all language code where translations have started - -for i in "${site[@]}" -do - echo "- Updating $i LINGUAS file" - PO_PATH="$i/po" - LINGUAS="$PO_PATH/LINGUAS" - - - if [ ! -f $LINGUAS ] - then - echo "No $LINGUAS file there" - fi - - tmp="l_tmp" - sed -i 's#\s##g' $LINGUAS # remove trailing whitespaces - - for file in `ls $PO_PATH/*.po` - do - stat=`msgfmt -c --statistics $file 2>&1 | awk '{print $1}'` - if [ "$stat" != "0" ] # if translation is started - then - lang=`echo $file| sed -n "s#.*/\(.*\).po#\1#p" ` # filter the language code - echo $lang >> $tmp # add it in a temp file - new=`grep $lang"\$" $LINGUAS` - if [ "@$new" == "@" ] # if this language code is new - then - echo "$lang added, translated strings=$stat" - fi - fi - done - - rm $LINGUAS - cat $tmp|sort > $LINGUAS - rm $tmp - - git diff --exit-code $LINGUAS > /dev/null # check if modified - if [ $? -eq 1 ] && [ ! -z $ADD ] - then - git add $LINGUAS - L_COMMIT=1 - fi -done - -if [ ! -z $L_COMMIT ] && [ ! -z $COMMIT ] && [ ! -z $ADD ] -then - git commit -m "[`basename $0`] Full LINGUAS update" -fi +# This is now handled in pullpos exit 0