Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions translations-app/handleAppTranslations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if [ ! -f '/app/.tx/config' ]; then
fi

APP_ID=$(grep -oE '<id>.*</id>' appinfo/info.xml | head --lines 1 | sed -E 's/<id>(.*)<\/id>/\1/')
IS_EX_APP=$(grep -q '<external-app>' appinfo/info.xml && grep -q '</external-app>' 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/')

Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ /translationtool.phar convert-po-files
Those files are ignored:
Array
(
    [0] => js/
    [1] => vendor/
    [2] => .venv/
    [3] => venv/
)
+ [ -d tests ]
+ git add l10n/an.js l10n/ar.js l10n/ast.js l10n/bg.js l10n/br.js l10n/ca.js l10n/cs.js l10n/da.js l10n/de.js l10n/de_DE.js l10n/el.js l10n/en_GB.js l10n/eo.js l10n/es.js l10n/es_419.js l10n/es_AR.js l10n/es_CL.js l10n/es_CO.js l10n/es_CR.js l10n/es_DO.js l10n/es_EC.js l10n/es_GT.js l10n/es_HN.js l10n/es_MX.js l10n/es_NI.js l10n/es_PA.js l10n/es_PE.js l10n/es_PR.js l10n/es_PY.js l10n/es_SV.js l10n/es_UY.js l10n/et_EE.js l10n/eu.js l10n/fa.js l10n/fi.js l10n/fr.js l10n/ga.js l10n/gl.js l10n/he.js l10n/hr.js l10n/hu.js l10n/ia.js l10n/id.js l10n/is.js l10n/it.js l10n/ja.js l10n/ka.js l10n/ka_GE.js l10n/ko.js l10n/lt_LT.js l10n/lv.js l10n/mk.js l10n/nb.js l10n/nl.js l10n/pl.js l10n/pt_BR.js l10n/pt_PT.js l10n/ro.js l10n/ru.js l10n/sc.js l10n/sk.js l10n/sl.js l10n/sq.js l10n/sr.js l10n/sv.js l10n/th.js l10n/tr.js l10n/ug.js l10n/uk.js l10n/zh_CN.js l10n/zh_HK.js l10n/zh_TW.js l10n/an.json l10n/ar.json l10n/ast.json l10n/bg.json l10n/br.json l10n/ca.json l10n/cs.json l10n/da.json l10n/de.json l10n/de_DE.json l10n/el.json l10n/en_GB.json l10n/eo.json l10n/es.json l10n/es_419.json l10n/es_AR.json l10n/es_CL.json l10n/es_CO.json l10n/es_CR.json l10n/es_DO.json l10n/es_EC.json l10n/es_GT.json l10n/es_HN.json l10n/es_MX.json l10n/es_NI.json l10n/es_PA.json l10n/es_PE.json l10n/es_PR.json l10n/es_PY.json l10n/es_SV.json l10n/es_UY.json l10n/et_EE.json l10n/eu.json l10n/fa.json l10n/fi.json l10n/fr.json l10n/ga.json l10n/gl.json l10n/he.json l10n/hr.json l10n/hu.json l10n/ia.json l10n/id.json l10n/is.json l10n/it.json l10n/ja.json l10n/ka.json l10n/ka_GE.json l10n/ko.json l10n/lt_LT.json l10n/lv.json l10n/mk.json l10n/nb.json l10n/nl.json l10n/pl.json l10n/pt_BR.json l10n/pt_PT.json l10n/ro.json l10n/ru.json l10n/sc.json l10n/sk.json l10n/sl.json l10n/sq.json l10n/sr.json l10n/sv.json l10n/th.json l10n/tr.json l10n/ug.json l10n/uk.json l10n/zh_CN.json l10n/zh_HK.json l10n/zh_TW.json
+ [ true = true ]
+ git add translationfiles/*.po translationfiles/*.mo
fatal: pathspec 'translationfiles/*.mo' did not match any files

fi

git commit -am "fix(l10n): Update translations from Transifex" -s || true
git push origin $version

Expand Down
6 changes: 5 additions & 1 deletion translations/translationtool/src/translationtool.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']
);

Expand All @@ -67,13 +67,17 @@ 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';
}

$language = '--language=';
if (substr($entry, -4) === '.php') {
$language .= 'PHP';
} elseif (substr($entry, -3) === '.py') {
$language .= 'Python';
} else {
$language .= 'Javascript';
}
Expand Down
Binary file modified translations/translationtool/translationtool.phar
Binary file not shown.