From 5bcb9d640b99ff9671aafcad41444cf70e2cddab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 14:45:55 +0100 Subject: [PATCH 01/44] fix: use correct file path github actions script --- .github/workflows/push-locize.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 915fed53..c263aaa1 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -1,7 +1,8 @@ name: Push JSON to Locize on: - workflow_dispatch: + pull_request: {} + jobs: push-locize: @@ -9,7 +10,7 @@ jobs: runs-on: ubuntu-latest environment: "CD" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 @@ -23,7 +24,7 @@ jobs: - name: Generate Translation JSON run: | - poetry run python ./translations/create_translation_json.py + poetry run python translations/create_translation_json.py - name: Push to Locize env: From 657b4316920bd073ae03f6ccd6af0367268d1235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 14:47:02 +0100 Subject: [PATCH 02/44] remove CD --- .github/workflows/push-locize.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index c263aaa1..071e5606 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -8,7 +8,6 @@ jobs: push-locize: name: "Push JSON to Locize" runs-on: ubuntu-latest - environment: "CD" steps: - uses: actions/checkout@v4 From 179a696d280b3fb67c86d4d0e0447b1d167c43ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 14:49:26 +0100 Subject: [PATCH 03/44] use correct file path --- .github/workflows/push-locize.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 071e5606..e074d9b4 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -21,9 +21,10 @@ jobs: pip install poetry poetry install - - name: Generate Translation JSON + - name: Generate Translation JSON + working-directory: translations run: | - poetry run python translations/create_translation_json.py + poetry run python create_translation_json.py - name: Push to Locize env: From 9745f5687853700a929ea7ff5c17836787c7fe2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 14:52:55 +0100 Subject: [PATCH 04/44] include ./ in working directory --- .github/workflows/push-locize.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index e074d9b4..ba3375ec 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -21,8 +21,8 @@ jobs: pip install poetry poetry install - - name: Generate Translation JSON - working-directory: translations + - name: Generate Translation JSON + working-directory: ./translations run: | poetry run python create_translation_json.py From 8e43951da08d9ab18af53365aa7c43738c53c67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 14:55:03 +0100 Subject: [PATCH 05/44] remove ./ and use cd --- .github/workflows/push-locize.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index ba3375ec..4ed1245b 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -22,8 +22,9 @@ jobs: poetry install - name: Generate Translation JSON - working-directory: ./translations run: | + cd .. + cd translations poetry run python create_translation_json.py - name: Push to Locize From c93e1f100836d0024a469c49747a1c2b56d467b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 14:56:10 +0100 Subject: [PATCH 06/44] include / --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 4ed1245b..7dada60c 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -24,7 +24,7 @@ jobs: - name: Generate Translation JSON run: | cd .. - cd translations + cd /translations poetry run python create_translation_json.py - name: Push to Locize From e3d2b9dfe8efe59fbe01aec96e2c27087b710775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 14:57:43 +0100 Subject: [PATCH 07/44] cd into translations --- .github/workflows/push-locize.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 7dada60c..8f1a03ef 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -23,7 +23,6 @@ jobs: - name: Generate Translation JSON run: | - cd .. cd /translations poetry run python create_translation_json.py From 84988492a0413d80c841864f97a01fd57e551dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 14:59:01 +0100 Subject: [PATCH 08/44] remove / --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 8f1a03ef..1ddd8cf1 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -23,7 +23,7 @@ jobs: - name: Generate Translation JSON run: | - cd /translations + cd translations poetry run python create_translation_json.py - name: Push to Locize From 9bb101ca2ae0dfcb8b618a718c5e786cb8e80136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 15:29:17 +0100 Subject: [PATCH 09/44] debug --- .github/workflows/push-locize.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 1ddd8cf1..6c3e22b5 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -21,10 +21,13 @@ jobs: pip install poetry poetry install + - name: List directory contents + run: | + ls -la + - name: Generate Translation JSON run: | - cd translations - poetry run python create_translation_json.py + poetry run python ../translations/create_translation_json.py - name: Push to Locize env: From 5a739bab19591fd7b88d2107fc0902907b5b8334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 15:34:04 +0100 Subject: [PATCH 10/44] add working directory --- .github/workflows/push-locize.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 6c3e22b5..6bb9b1e9 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -26,8 +26,9 @@ jobs: ls -la - name: Generate Translation JSON + working-directory: ./translations run: | - poetry run python ../translations/create_translation_json.py + poetry run python create_translation_json.py - name: Push to Locize env: From 673d230d7f402a51c0e3db30b1739a1e76c4729c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 15:40:56 +0100 Subject: [PATCH 11/44] get directory --- .github/workflows/push-locize.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 6bb9b1e9..4ffdfc9a 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -11,6 +11,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get directory + run: | + pwd + ls + - name: Set up Python uses: actions/setup-python@v5 with: From 10ccd18983826c21fed293f0ea7b68ff82c32b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 15:43:12 +0100 Subject: [PATCH 12/44] default to working-directory --- .github/workflows/push-locize.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 4ffdfc9a..a12838b4 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -8,6 +8,9 @@ jobs: push-locize: name: "Push JSON to Locize" runs-on: ubuntu-latest + defaults: + run: + working-directory: ./translations steps: - uses: actions/checkout@v4 @@ -26,10 +29,6 @@ jobs: pip install poetry poetry install - - name: List directory contents - run: | - ls -la - - name: Generate Translation JSON working-directory: ./translations run: | From d8ad1f975b520ba18bc337be0953560debbf8fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 15:46:31 +0100 Subject: [PATCH 13/44] change working directory --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index a12838b4..e0f82d94 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./translations + working-directory: /home/runner/work/indsl/translations steps: - uses: actions/checkout@v4 From 5d54cf3c5443636701ff8e3c6a094d233be59b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 15:49:33 +0100 Subject: [PATCH 14/44] try different default directory --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index e0f82d94..345bfece 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: /home/runner/work/indsl/translations + working-directory: ../translations steps: - uses: actions/checkout@v4 From a941e0cd88c10df776383623c372ea5306421c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Gilberg?= Date: Wed, 31 Jan 2024 15:50:24 +0100 Subject: [PATCH 15/44] use single dot --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 345bfece..a12838b4 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ../translations + working-directory: ./translations steps: - uses: actions/checkout@v4 From 68c20f136f06dc55c9e2d040951b2f8aabd40ea6 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Wed, 31 Jan 2024 16:33:34 +0100 Subject: [PATCH 16/44] fix: path --- translations/create_translation_json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index fa8c74bb..5b48f470 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -1,6 +1,6 @@ import inspect import json -import os +import pathlib import re import typing @@ -125,7 +125,7 @@ def create_mapping_for_translations(): def create_json_file(): """Create mapping for InDSL and write to file.""" output_dict = create_mapping_for_translations() - file_path = os.path.join(os.path.dirname(__file__), "en", "translated_docstrings.json") + file_path = pathlib.Path(__file__).parent / "en/translated_operations.json" with open(file_path, "w") as f: json.dump(output_dict, f, indent=4) From 241d5d2766c671b0cacfb18531ebfedb37d74f95 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Wed, 31 Jan 2024 16:35:15 +0100 Subject: [PATCH 17/44] fix: path --- translations/create_translation_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index 5b48f470..a87ee42b 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -125,7 +125,7 @@ def create_mapping_for_translations(): def create_json_file(): """Create mapping for InDSL and write to file.""" output_dict = create_mapping_for_translations() - file_path = pathlib.Path(__file__).parent / "en/translated_operations.json" + file_path = "translated_operations.json" with open(file_path, "w") as f: json.dump(output_dict, f, indent=4) From fb7162c607374b6b06624a570e204213521f3986 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Wed, 31 Jan 2024 16:40:23 +0100 Subject: [PATCH 18/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index a12838b4..1d5fbbc0 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -43,4 +43,4 @@ jobs: -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ --data-binary "@translations/en/translated_docstrings.json" \ - "https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en" + "https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en" || echo "Locize Publishing Failed" From 4ba715018d1fd646459e581849dbf292fc45c687 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Wed, 31 Jan 2024 16:43:04 +0100 Subject: [PATCH 19/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 1d5fbbc0..7b19409b 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -42,5 +42,5 @@ jobs: curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ - --data-binary "@translations/en/translated_docstrings.json" \ + --data-binary "@translated_docstrings.json" \ "https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en" || echo "Locize Publishing Failed" From 34bc93edb8bfea4b4bc5d80b865c5cb4ae248047 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Wed, 31 Jan 2024 16:46:04 +0100 Subject: [PATCH 20/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 7b19409b..bbb92654 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -42,5 +42,5 @@ jobs: curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ - --data-binary "@translated_docstrings.json" \ + -d @translated_docstrings.json" \ "https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en" || echo "Locize Publishing Failed" From 7032537891f4636360cd2b7bea4714b5faacf591 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Wed, 31 Jan 2024 16:48:29 +0100 Subject: [PATCH 21/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index bbb92654..28bc5399 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -42,5 +42,5 @@ jobs: curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ - -d @translated_docstrings.json" \ + -d @translated_docstrings.json \ "https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en" || echo "Locize Publishing Failed" From f4a0ca32be4a5553a15a20b0e54d590a778ff7fc Mon Sep 17 00:00:00 2001 From: neringaalt Date: Wed, 31 Jan 2024 16:54:28 +0100 Subject: [PATCH 22/44] fix: path --- .github/workflows/push-locize.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 28bc5399..255df444 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -35,12 +35,14 @@ jobs: poetry run python create_translation_json.py - name: Push to Locize + working-directory: ./translations env: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | + content=`cat translated_docstrings.json` curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ - -d @translated_docstrings.json \ + -d content \ "https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en" || echo "Locize Publishing Failed" From b9f20dc388f7eb03c6282dd4b5facbb489a7b086 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 17:52:25 +0100 Subject: [PATCH 23/44] fix: path --- .github/workflows/push-locize.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 255df444..b90f16ed 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -40,9 +40,8 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | - content=`cat translated_docstrings.json` curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ - -d content \ - "https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en" || echo "Locize Publishing Failed" + -d @translated_docstrings.json \ + https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en || echo "Locize Publishing Failed" From b2b36237c7dd7d82de66c75c7395965228a22127 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 17:55:55 +0100 Subject: [PATCH 24/44] fix: path --- .github/workflows/push-locize.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index b90f16ed..20f13c6d 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -40,6 +40,7 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | + cat translated_docstrings.json curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ From 344aee18a8dd2053460baabe95adb5acbc417814 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 17:58:49 +0100 Subject: [PATCH 25/44] fix: path --- .github/workflows/push-locize.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 20f13c6d..bc4d2293 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -33,6 +33,8 @@ jobs: working-directory: ./translations run: | poetry run python create_translation_json.py + cat translated_docstrings.json + - name: Push to Locize working-directory: ./translations @@ -40,7 +42,6 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | - cat translated_docstrings.json curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ From 8fcf2c0a55dd6cd383a05111845d8ece9aea4a9e Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 19:30:27 +0100 Subject: [PATCH 26/44] fix: path --- .github/workflows/push-locize.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index bc4d2293..413902aa 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -33,8 +33,8 @@ jobs: working-directory: ./translations run: | poetry run python create_translation_json.py - cat translated_docstrings.json - + pwd + ls - name: Push to Locize working-directory: ./translations From afc9e833e965e063c069958f5c4635c2b43e42fe Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 19:32:18 +0100 Subject: [PATCH 27/44] fix: path --- .github/workflows/push-locize.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 413902aa..005e4d39 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -33,8 +33,6 @@ jobs: working-directory: ./translations run: | poetry run python create_translation_json.py - pwd - ls - name: Push to Locize working-directory: ./translations @@ -45,5 +43,5 @@ jobs: curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ - -d @translated_docstrings.json \ + -d @translated_operations.json \ https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en || echo "Locize Publishing Failed" From 008ac363de0d415b3971467565a2f0fbc5fdbb06 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 19:45:17 +0100 Subject: [PATCH 28/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 005e4d39..44695896 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -40,7 +40,7 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | - curl -X POST \ + curl --fail -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ From 2bd303d544e47377cc023d602ad9324281ab976d Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 19:51:24 +0100 Subject: [PATCH 29/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 44695896..8705be11 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -40,7 +40,7 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | - curl --fail -X POST \ + curl --fail --request -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ From 8a0026cf1c806f6f306ee04b3e20a962ade1eee6 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 19:55:21 +0100 Subject: [PATCH 30/44] fix: path --- .github/workflows/push-locize.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 8705be11..366655ac 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -40,8 +40,17 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | - curl --fail --request -X POST \ + response=$(curl -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ - https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en || echo "Locize Publishing Failed" + https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en) + status_code=$(echo "$response" | grep -Fi HTTP/ | awk '{print $2}') + echo "Locize API Response Status Code: $status_code" + echo "Locize API Response Body:" + echo "$response" + + if [ "$status_code" -ne 200 ]; then + echo "Locize API request failed with status code $status_code" + exit 1 + fi From bef47ac4782da50a5b06db8accf699d8fc171981 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 19:58:45 +0100 Subject: [PATCH 31/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 366655ac..9fc62c55 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -40,7 +40,7 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | - response=$(curl -X POST \ + response=$(curl -i -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ From 833fbd4ab0ee26e48c2188b53dfb79da20d6f289 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:02:24 +0100 Subject: [PATCH 32/44] fix: path --- .github/workflows/push-locize.yaml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 9fc62c55..4f99d021 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -40,17 +40,13 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | - response=$(curl -i -X POST \ + curl --fail --show-error -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ - https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en) - status_code=$(echo "$response" | grep -Fi HTTP/ | awk '{print $2}') - echo "Locize API Response Status Code: $status_code" - echo "Locize API Response Body:" - echo "$response" - - if [ "$status_code" -ne 200 ]; then - echo "Locize API request failed with status code $status_code" - exit 1 + https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en + if [[ $? != 0 ]] ; then + echo "error" + exit 1 fi + echo "worked" From 566225ddc5d9d791faf2605e60af30151ce74acb Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:05:03 +0100 Subject: [PATCH 33/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 4f99d021..64d94d8f 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -40,7 +40,7 @@ jobs: LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }} LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }} run: | - curl --fail --show-error -X POST \ + curl --fail-with-body -X POST \ -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ From 33c5bcb0c87f7bd14e6174f40d5432723258e337 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:07:33 +0100 Subject: [PATCH 34/44] fix: path --- .github/workflows/push-locize.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 64d94d8f..7861927c 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -45,8 +45,4 @@ jobs: -H "Content-Type: application/json" \ -d @translated_operations.json \ https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en - if [[ $? != 0 ]] ; then - echo "error" - exit 1 - fi - echo "worked" + From 0e748e5e1e84c1ce4cd19f42559f4c9a79e018ad Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:09:26 +0100 Subject: [PATCH 35/44] fix: path --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 7861927c..2798017c 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -44,5 +44,5 @@ jobs: -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ - https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/indsl/en + https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/en/indsl From f13a4271a4b5d5fd3486c486f02fb87b4ce912a3 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:15:05 +0100 Subject: [PATCH 36/44] fix: path --- translations/create_translation_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index a87ee42b..000a7724 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -113,7 +113,7 @@ def create_mapping_for_translations(): output_dict = {} for _, module in inspect.getmembers(indsl, inspect.ismodule): toolbox_name = getattr(module, TOOLBOX_NAME, None) - if toolbox_name is not None and toolbox_name != "Not listed operations": + if toolbox_name is not None and toolbox_name != "Not listed operations" and toolbox_name != "Operators": output_dict[create_key(toolbox=toolbox_name)] = toolbox_name _generate_translation_mapping_for_functions(output_dict, module) From 3b1d27952657bc76bc6bde244b7f4c5145d243c2 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:18:39 +0100 Subject: [PATCH 37/44] fix: path --- translations/create_translation_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index 000a7724..a87ee42b 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -113,7 +113,7 @@ def create_mapping_for_translations(): output_dict = {} for _, module in inspect.getmembers(indsl, inspect.ismodule): toolbox_name = getattr(module, TOOLBOX_NAME, None) - if toolbox_name is not None and toolbox_name != "Not listed operations" and toolbox_name != "Operators": + if toolbox_name is not None and toolbox_name != "Not listed operations": output_dict[create_key(toolbox=toolbox_name)] = toolbox_name _generate_translation_mapping_for_functions(output_dict, module) From bab42b318daf737359278f09d610209aa9cbf82e Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:22:47 +0100 Subject: [PATCH 38/44] fix: path --- translations/create_translation_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index a87ee42b..0aa4e83d 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -113,7 +113,7 @@ def create_mapping_for_translations(): output_dict = {} for _, module in inspect.getmembers(indsl, inspect.ismodule): toolbox_name = getattr(module, TOOLBOX_NAME, None) - if toolbox_name is not None and toolbox_name != "Not listed operations": + if toolbox_name == "Operators": output_dict[create_key(toolbox=toolbox_name)] = toolbox_name _generate_translation_mapping_for_functions(output_dict, module) From a56f5c54e14d5ae70ec150da8306cf8ed838512e Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:37:57 +0100 Subject: [PATCH 39/44] fix: linting --- .github/workflows/push-locize.yaml | 8 +------- translations/create_translation_json.py | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 2798017c..03f12206 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -14,11 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get directory - run: | - pwd - ls - - name: Set up Python uses: actions/setup-python@v5 with: @@ -44,5 +39,4 @@ jobs: -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ - https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/en/indsl - + https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/en/indsl/ diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index 0aa4e83d..a4caf1a3 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -1,6 +1,5 @@ import inspect import json -import pathlib import re import typing From eed449789ad8c5dbbb6e88d0d538b747a515b634 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Thu, 1 Feb 2024 20:39:33 +0100 Subject: [PATCH 40/44] fix: changing back --- translations/create_translation_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index a4caf1a3..0bc1d2e2 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -112,7 +112,7 @@ def create_mapping_for_translations(): output_dict = {} for _, module in inspect.getmembers(indsl, inspect.ismodule): toolbox_name = getattr(module, TOOLBOX_NAME, None) - if toolbox_name == "Operators": + if toolbox_name is not None and toolbox_name != "Not listed operations": output_dict[create_key(toolbox=toolbox_name)] = toolbox_name _generate_translation_mapping_for_functions(output_dict, module) From 2dc6be15a051ca01c97a19e808119b238f49cf16 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Fri, 2 Feb 2024 11:15:24 +0100 Subject: [PATCH 41/44] fix: fixing url --- .github/workflows/push-locize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index 03f12206..dd8ebc66 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -39,4 +39,4 @@ jobs: -H "Authorization: Bearer $LOCIZE_API_KEY" \ -H "Content-Type: application/json" \ -d @translated_operations.json \ - https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/en/indsl/ + https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/en/indsl From 86ad9331b1176a87e0821b113844e924eef906f4 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Fri, 2 Feb 2024 11:18:17 +0100 Subject: [PATCH 42/44] fix: push strings --- translations/create_translation_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index 0bc1d2e2..a4caf1a3 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -112,7 +112,7 @@ def create_mapping_for_translations(): output_dict = {} for _, module in inspect.getmembers(indsl, inspect.ismodule): toolbox_name = getattr(module, TOOLBOX_NAME, None) - if toolbox_name is not None and toolbox_name != "Not listed operations": + if toolbox_name == "Operators": output_dict[create_key(toolbox=toolbox_name)] = toolbox_name _generate_translation_mapping_for_functions(output_dict, module) From 140d36213a1abc959d1c088a0413689dfcaf9965 Mon Sep 17 00:00:00 2001 From: neringaalt Date: Fri, 2 Feb 2024 11:23:05 +0100 Subject: [PATCH 43/44] fix: push strings 2 --- translations/create_translation_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index a4caf1a3..1832f8bb 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -112,7 +112,7 @@ def create_mapping_for_translations(): output_dict = {} for _, module in inspect.getmembers(indsl, inspect.ismodule): toolbox_name = getattr(module, TOOLBOX_NAME, None) - if toolbox_name == "Operators": + if toolbox_name is not None and toolbox_name != "Not listed operations" and toolbox_name != "Operators": output_dict[create_key(toolbox=toolbox_name)] = toolbox_name _generate_translation_mapping_for_functions(output_dict, module) From e8a04bf2e7f7a29c0aa23e347b1a643e0b42ebaa Mon Sep 17 00:00:00 2001 From: neringaalt Date: Fri, 2 Feb 2024 11:28:42 +0100 Subject: [PATCH 44/44] fix: update github action --- .github/workflows/push-locize.yaml | 3 +-- translations/create_translation_json.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push-locize.yaml b/.github/workflows/push-locize.yaml index dd8ebc66..135f7ecf 100644 --- a/.github/workflows/push-locize.yaml +++ b/.github/workflows/push-locize.yaml @@ -1,8 +1,7 @@ name: Push JSON to Locize on: - pull_request: {} - + workflow_dispatch: jobs: push-locize: diff --git a/translations/create_translation_json.py b/translations/create_translation_json.py index 1832f8bb..0bc1d2e2 100644 --- a/translations/create_translation_json.py +++ b/translations/create_translation_json.py @@ -112,7 +112,7 @@ def create_mapping_for_translations(): output_dict = {} for _, module in inspect.getmembers(indsl, inspect.ismodule): toolbox_name = getattr(module, TOOLBOX_NAME, None) - if toolbox_name is not None and toolbox_name != "Not listed operations" and toolbox_name != "Operators": + if toolbox_name is not None and toolbox_name != "Not listed operations": output_dict[create_key(toolbox=toolbox_name)] = toolbox_name _generate_translation_mapping_for_functions(output_dict, module)