Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Publishing locize action #111

Merged
merged 45 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5bcb9d6
fix: use correct file path github actions script
VebjornG Jan 31, 2024
657b431
remove CD
VebjornG Jan 31, 2024
179a696
use correct file path
VebjornG Jan 31, 2024
9745f56
include ./ in working directory
VebjornG Jan 31, 2024
8e43951
remove ./ and use cd
VebjornG Jan 31, 2024
c93e1f1
include /
VebjornG Jan 31, 2024
e3d2b9d
cd into translations
VebjornG Jan 31, 2024
8498849
remove /
VebjornG Jan 31, 2024
9bb101c
debug
VebjornG Jan 31, 2024
5a739ba
add working directory
VebjornG Jan 31, 2024
673d230
get directory
VebjornG Jan 31, 2024
10ccd18
default to working-directory
VebjornG Jan 31, 2024
d8ad1f9
change working directory
VebjornG Jan 31, 2024
5d54cf3
try different default directory
VebjornG Jan 31, 2024
a941e0c
use single dot
VebjornG Jan 31, 2024
68c20f1
fix: path
neringaalt Jan 31, 2024
241d5d2
fix: path
neringaalt Jan 31, 2024
fb7162c
fix: path
neringaalt Jan 31, 2024
4ba7150
fix: path
neringaalt Jan 31, 2024
34bc93e
fix: path
neringaalt Jan 31, 2024
7032537
fix: path
neringaalt Jan 31, 2024
f4a0ca3
fix: path
neringaalt Jan 31, 2024
b9f20dc
fix: path
neringaalt Feb 1, 2024
b2b3623
fix: path
neringaalt Feb 1, 2024
344aee1
fix: path
neringaalt Feb 1, 2024
8fcf2c0
fix: path
neringaalt Feb 1, 2024
afc9e83
fix: path
neringaalt Feb 1, 2024
008ac36
fix: path
neringaalt Feb 1, 2024
2bd303d
fix: path
neringaalt Feb 1, 2024
8a0026c
fix: path
neringaalt Feb 1, 2024
bef47ac
fix: path
neringaalt Feb 1, 2024
833fbd4
fix: path
neringaalt Feb 1, 2024
566225d
fix: path
neringaalt Feb 1, 2024
33c5bcb
fix: path
neringaalt Feb 1, 2024
0e748e5
fix: path
neringaalt Feb 1, 2024
f13a427
fix: path
neringaalt Feb 1, 2024
3b1d279
fix: path
neringaalt Feb 1, 2024
bab42b3
fix: path
neringaalt Feb 1, 2024
a56f5c5
fix: linting
neringaalt Feb 1, 2024
eed4497
fix: changing back
neringaalt Feb 1, 2024
2dc6be1
fix: fixing url
neringaalt Feb 2, 2024
86ad933
fix: push strings
neringaalt Feb 2, 2024
140d362
fix: push strings 2
neringaalt Feb 2, 2024
e8a04bf
fix: update github action
neringaalt Feb 2, 2024
c373991
Merge branch 'main' into publishing_locize_action
neringaalt Feb 2, 2024
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
14 changes: 9 additions & 5 deletions .github/workflows/push-locize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ jobs:
push-locize:
name: "Push JSON to Locize"
runs-on: ubuntu-latest
environment: "CD"
defaults:
run:
working-directory: ./translations
steps:
- uses: actions/checkout@v4

Expand All @@ -22,16 +24,18 @@ jobs:
poetry install

- 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
working-directory: ./translations
env:
LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }}
LOCIZE_PROJECT_ID: ${{ secrets.LOCIZE_PROJECT_ID }}
run: |
curl -X POST \
curl --fail-with-body -X POST \
-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"
-d @translated_operations.json \
https://api.locize.app/update/$LOCIZE_PROJECT_ID/latest/en/indsl
3 changes: 1 addition & 2 deletions translations/create_translation_json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import inspect
import json
import os
import re
import typing

Expand Down Expand Up @@ -125,7 +124,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 = "translated_operations.json"
with open(file_path, "w") as f:
json.dump(output_dict, f, indent=4)

Expand Down