From bf80f21bb94b262100eaf83e5e6ce3d09c25ec02 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 21 May 2021 22:16:36 +0200 Subject: [PATCH 1/4] Fix Drone for PR messages.po check --- .drone.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index f648ce2c0..304a74532 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,21 +19,16 @@ steps: - name: clone friendica addon image: alpine/git commands: - - git clone $DRONE_REMOTE_URL addon - - git checkout $DRONE_COMMIT_REF - - name: Run default Xgettext + - git clone $DRONE_REPO_LINK addon + - cd addon/ + - git checkout $DRONE_COMMIT_BRANCH + - git fetch origin $DRONE_COMMIT_REF + - git merge $DRONE_COMMIT_SHA + - name: Run Xgettext for addons image: friendicaci/transifex commands: - - export CHANGED_FILES=($(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2)) - - export FIND_RESULT=$(printf "%s\n" "$CHANGED_FILES[@]" | sed '/^\./d' | cut -d "/" -f1 | uniq) - - for addon in $FIND_RESULT; do ./bin/run_xgettext.sh --addon $addon; done + - /xgettext-addon.sh - name: Check update necessary - image: alpine/git + image: friendicaci/transifex commands: - - cd addon/ - - if [[ $(git diff -U0 "**/messages.po" | awk '!/index|diff|\-\-\-|\+\+\+|@@|\-"POT-Creation-Date|\+"POT-Creation-Date|\+#|\-#/{print }' | wc -l) > 0 ]]; then - echo "::error file=messages.po::messages.po is out of date" - exit 1 - else - echo "Nothing to update" - fi + - /check-addons.sh From 719dee2cffe1fcb4ac556a843e02ac2ffd5d02b1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 13:49:30 +0200 Subject: [PATCH 2/4] Add temporary missed translations --- blackout/blackout.php | 2 ++ blockbot/blockbot.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/blackout/blackout.php b/blackout/blackout.php index cfe4bbb71..3469048ce 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -78,6 +78,8 @@ function blackout_redirect ($a, $b) { Logger::log('redirecting user to blackout page'); System::externalRedirect($myurl); } + + DI::l10n()->t('blub'); } function blackout_addon_admin(&$a, &$o) { diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php index b602bf63b..2f2c055a1 100644 --- a/blockbot/blockbot.php +++ b/blockbot/blockbot.php @@ -37,6 +37,8 @@ function blockbot_addon_admin_post(&$a) { DI::config()->set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false); DI::config()->set('blockbot', 'block_gab', $_POST['block_gab'] ?? false); DI::config()->set('blockbot', 'training', $_POST['training'] ?? false); + + DI::l10n()->t('blub'); } function blockbot_init_1(App $a) { From 05c98064b4d624fcdf5e7481f66704056da007ea Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 13:50:42 +0200 Subject: [PATCH 3/4] Remove temporary missed translations --- blackout/blackout.php | 2 -- blockbot/blockbot.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/blackout/blackout.php b/blackout/blackout.php index 3469048ce..cfe4bbb71 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -78,8 +78,6 @@ function blackout_redirect ($a, $b) { Logger::log('redirecting user to blackout page'); System::externalRedirect($myurl); } - - DI::l10n()->t('blub'); } function blackout_addon_admin(&$a, &$o) { diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php index 2f2c055a1..b602bf63b 100644 --- a/blockbot/blockbot.php +++ b/blockbot/blockbot.php @@ -37,8 +37,6 @@ function blockbot_addon_admin_post(&$a) { DI::config()->set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false); DI::config()->set('blockbot', 'block_gab', $_POST['block_gab'] ?? false); DI::config()->set('blockbot', 'training', $_POST['training'] ?? false); - - DI::l10n()->t('blub'); } function blockbot_init_1(App $a) { From dbde5358c69d9204c6453e7375a1cccbb7dca86a Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 22 May 2021 13:52:12 +0200 Subject: [PATCH 4/4] Remove github workflow --- .github/workflows/transifex.yml | 48 --------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 .github/workflows/transifex.yml diff --git a/.github/workflows/transifex.yml b/.github/workflows/transifex.yml deleted file mode 100644 index c979dd79a..000000000 --- a/.github/workflows/transifex.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Transifex -on: [pull_request] - -jobs: - messages: - name: Check messages.po changes - runs-on: ubuntu-latest - steps: - - name: Install gettext - run: sudo apt-get install gettext - - - name: Checkout Friendica Base - uses: actions/checkout@v2 - with: - repository: 'friendica/friendica' - ref: ${{ github.base_ref }} - - - name: Checkout current Friendica Addons - uses: actions/checkout@v2 - with: - path: 'addon' - - - name: Get changed files - id: changes - uses: jitterbit/get-changed-files@v1 - - - name: Run Xgettext for each changed addon - run: | - addon_files=(${{ steps.changes.outputs.all }}) - find_result=$(printf "%s\n" "${addon_files[@]}" | sed '/^\./d' | cut -d "/" -f1 | uniq) - for addon in $find_result - do - ./bin/run_xgettext.sh --addon $addon - done - - - name: Check if messages.po needs an update - run: | - echo "::group::Check messages.po" - # Skip all lines of the git diff starting with "@@" or comments or starting "POT-Creation-Date" - cd addon/ - if [[ $(git diff -U0 "**/messages.po" | awk '!/index|diff|\-\-\-|\+\+\+|@@|\-"POT-Creation-Date|\+"POT-Creation-Date|\+#|\-#/{print }' | wc -l) > 0 ]]; then - echo "::error file=messages.po::messages.po is out of date" - exit 1 - else - echo "Nothing to update" - fi - echo "::endgroup::" - shell: bash