diff --git a/translations-app/handleAppTranslations.sh b/translations-app/handleAppTranslations.sh index fb60dd8d..964e2194 100755 --- a/translations-app/handleAppTranslations.sh +++ b/translations-app/handleAppTranslations.sh @@ -17,6 +17,7 @@ if [ ! -f '/app/.tx/config' ]; then fi APP_ID=$(grep -oE '.*' appinfo/info.xml | head --lines 1 | sed -E 's/(.*)<\/id>/\1/') +IS_EX_APP=$(grep -q '' appinfo/info.xml && grep -q '' appinfo/info.xml && echo "true" || echo "false") RESOURCE_ID=$(grep -oE '\[o:nextcloud:p:nextcloud:r:.*\]' .tx/config | sed -E 's/\[o:nextcloud:p:nextcloud:r:(.*)\]/\1/') SOURCE_FILE=$(grep -oE '^source_file\s*=\s*(.+)$' .tx/config | sed -E 's/source_file\s*=\s*(.+)/\1/') @@ -136,6 +137,12 @@ do # create git commit and push it git add l10n/*.js l10n/*.json + + # for ExApps, we need to include .po,.mo translation files as well + if [ "$IS_EX_APP" = "true" ]; then + git add translationfiles/*.po translationfiles/*.mo + fi + git commit -am "fix(l10n): Update translations from Transifex" -s || true git push origin $version diff --git a/translations/translationtool/src/translationtool.php b/translations/translationtool/src/translationtool.php index 5222e18d..cbe8a5c5 100644 --- a/translations/translationtool/src/translationtool.php +++ b/translations/translationtool/src/translationtool.php @@ -55,7 +55,7 @@ public function createOrCheckPotFile(bool $checkFiles = false): void { $this->createFakeFileForVueFiles(); $this->createFakeFileForLocale(); $translatableFiles = $this->findTranslatableFiles( - ['.php', '.js', '.jsx', '.mjs', '.html', '.ts', '.tsx'], + ['.php', '.js', '.jsx', '.mjs', '.html', '.ts', '.tsx', '.py'], ['.min.js'] ); @@ -67,6 +67,8 @@ public function createOrCheckPotFile(bool $checkFiles = false): void { $keywords = ''; if (substr($entry, -4) === '.php') { $keywords = '--keyword=t --keyword=n:1,2'; + } elseif (substr($entry, -3) === '.py') { + $keywords = '--keyword=_ --keyword=_n:1,2'; } else { $keywords = '--keyword=t:2 --keyword=n:2,3'; } @@ -74,6 +76,8 @@ public function createOrCheckPotFile(bool $checkFiles = false): void { $language = '--language='; if (substr($entry, -4) === '.php') { $language .= 'PHP'; + } elseif (substr($entry, -3) === '.py') { + $language .= 'Python'; } else { $language .= 'Javascript'; } diff --git a/translations/translationtool/translationtool.phar b/translations/translationtool/translationtool.phar index d1f7e71e..0e152a93 100755 Binary files a/translations/translationtool/translationtool.phar and b/translations/translationtool/translationtool.phar differ