diff options
author | Joas Schilling <coding@schilljs.com> | 2022-09-12 08:46:16 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-09-12 08:48:32 +0300 |
commit | d70f0269d6eb324b289f024e9027735c511d8efb (patch) | |
tree | 2206465aa5635086f2a55004ff35cde362a9bbf5 | |
parent | e51b72ed4c034380a9a5651790c2fd5cd46aa664 (diff) |
Fix the source file name for apps where the resource id is not the app id
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rwxr-xr-x | translations-app/handleAppTranslations.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/translations-app/handleAppTranslations.sh b/translations-app/handleAppTranslations.sh index 1c1ce54..59c5bee 100755 --- a/translations-app/handleAppTranslations.sh +++ b/translations-app/handleAppTranslations.sh @@ -18,6 +18,8 @@ fi APP_ID=$(grep -oE '<id>.*</id>' appinfo/info.xml | head --lines 1 | sed -E 's/<id>(.*)<\/id>/\1/') RESOURCE_ID=$(grep -oE '\[nextcloud\..*\]' .tx/config | sed -E 's/\[nextcloud.(.*)\]/\1/') +SOURCE_FILE=$( grep -oE '^source_file\s*=\s*(.+)$' | sed -E 's/source_file\s*=\s*(.+)/\1/') + if [ "$RESOURCE_ID" = "MYAPP" ]; then echo "Invalid transifex configuration file .tx/config (translating MYAPP instead of real value)" exit 2 @@ -72,13 +74,13 @@ done for file in $(ls stable-templates/master.*) do name=$(echo $file | cut -b 25- ) - msgcat --use-first stable-templates/*.$name > translationfiles/templates/$name + msgcat --use-first stable-templates/*.$name > $SOURCE_FILE done # alternative merge of main branch for file in $(ls stable-templates/main.*) do name=$(echo $file | cut -b 23- ) - msgcat --use-first stable-templates/*.$name > translationfiles/templates/$name + msgcat --use-first stable-templates/*.$name > $SOURCE_FILE done # remove intermediate POT files |