Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/docker-ci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-09-01 14:58:09 +0300
committerGitHub <noreply@github.com>2022-09-01 14:58:09 +0300
commit24846694efb469056111795d293bb2144ecf46d1 (patch)
tree3ad9a2de52e6993429c9a0a0730769664f08eeb3
parent7eb9e66d4f13069b8e9e0660c67d3d893e72ec8c (diff)
parenta6cd62e131d6e18361075e6936dd949e29378aa9 (diff)
Merge pull request #410 from nextcloud/bugfix/400/read-resource-name-from-config
Fix transifex sync with resource vs appid mismatch
-rwxr-xr-xtranslations-app/handleAppTranslations.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/translations-app/handleAppTranslations.sh b/translations-app/handleAppTranslations.sh
index 175d873..602d246 100755
--- a/translations-app/handleAppTranslations.sh
+++ b/translations-app/handleAppTranslations.sh
@@ -16,12 +16,9 @@ if [ ! -f '/app/.tx/config' ]; then
exit 1
fi
-# We actually want this command to fail
-set +e
-grep 'MYAPP' '/app/.tx/config'
-INVALID_CONFIG=$?
-set -e
-if [ "$INVALID_CONFIG" = "0" ]; then
+APP_ID=$(grep -oE '<id>.*</id>' appinfo/info.xml | sed -E 's/<id>(.*)<\/id>/\1/')
+RESOURCE_ID=$(grep -oE '\[nextcloud\..*\]' .tx/config | sed -E 's/\[nextcloud.(.*)\]/\1/')
+if [ "$RESOURCE_ID" = "MYAPP" ]; then
echo "Invalid transifex configuration file .tx/config (translating MYAPP instead of real value)"
exit 2
fi
@@ -66,7 +63,7 @@ do
cd translationfiles/templates/
for file in $(ls)
do
- mv $file ../../stable-templates/$version.$file
+ mv $file ../../stable-templates/$version.$RESOURCE_ID.pot
done
cd ../..
done
@@ -93,6 +90,22 @@ tx push -s
# pull translations - force pull because a fresh clone has newer time stamps
tx pull -f -a --minimum-perc=5
+# Copy back the po files from transifex resource id to app id
+if [ "$RESOURCE_ID" = "$APP_ID" ] ; then
+ echo 'App id and transifex resource id are the same, not renaming po files …'
+else
+ echo "App id [$APP_ID] and transifex resource id [$RESOURCE_ID] mismatch"
+ echo 'Renaming po files …'
+ for file in $(ls translationfiles)
+ do
+ if [ "$file" = 'templates' ]; then
+ continue;
+ fi
+
+ mv translationfiles/$file/$RESOURCE_ID.po translationfiles/$file/$APP_ID.po
+ done
+fi
+
# reverse version list to apply backports
backportVersions=$(echo $versions | awk '{for(i=NF;i>=1;i--) printf "%s ", $i;print ""}')
for version in $backportVersions