Skip to content

Commit

Permalink
BAH-3002 | Add. Script To Push Translations To Transifex
Browse files Browse the repository at this point in the history
* [Parvathy, Rahul] | BAH-3002 | Add. Script To Push Translations to Transifex

Co-authored-by: Parvathy Babu <parvathy.babu@thoughtworks.com>

* [Parvathy, Rahul] | BAH-3002 | Add. Resource To Transifex Config

Co-authored-by: Parvathy Babu <parvathy.babu@thoughtworks.com>

---------

Co-authored-by: Parvathy Babu <parvathy.babu@thoughtworks.com>
  • Loading branch information
rahu1ramesh and parvathy00 authored Sep 19, 2023
1 parent 469c441 commit a8bb471
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 29 deletions.
26 changes: 26 additions & 0 deletions .github/scripts/transifex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

function command_exists() {
command -v "$1" >/dev/null 2>&1
}

if ! command_exists tx; then
echo "Transifex CLI is not installed. Installing..."
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
mv tx /usr/local/bin/tx
fi

if [ ! -f .tx/config ]; then
echo "Transifex config file (.tx/config) not found in the repository."
exit 1
fi

echo "Pushing translation source file to Transifex..."
tx push -s

if [ $? -ne 0 ]; then
echo "Error: Transifex push failed. Please check the error message above."
exit 1
else
echo "Translation source file successfully pushed to Transifex."
fi
5 changes: 5 additions & 0 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
run: cd ui && yarn cache clean && /bin/bash ./scripts/package.sh
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Push Translations to Transifex
run: |
bash .github/scripts/transifex.sh
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
Expand Down
107 changes: 79 additions & 28 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,94 @@
host = https://www.transifex.com

[o:openmrs:p:bahmni:r:admin-app]
file_filter = ui/app/i18n/admin/locale_<lang>.json
source_file = ui/app/i18n/admin/locale_en.json
source_lang = en
type = KEYVALUEJSON
file_filter = ui/app/i18n/admin/locale_<lang>.json
source_file = ui/app/i18n/admin/locale_en.json
source_lang = en
type = KEYVALUEJSON
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:adt-app]
file_filter = ui/app/i18n/adt/locale_<lang>.json
source_file = ui/app/i18n/adt/locale_en.json
source_lang = en
type = KEYVALUEJSON
file_filter = ui/app/i18n/adt/locale_<lang>.json
source_file = ui/app/i18n/adt/locale_en.json
source_lang = en
type = KEYVALUEJSON
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:appointments-app]
file_filter = ui/app/i18n/appointments/locale_<lang>.json
source_file = ui/app/i18n/appointments/locale_en.json
type = KEYVALUEJSON
minimum_perc = 0
resource_name = Appointments App
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:clinical-app]
file_filter = ui/app/i18n/clinical/locale_<lang>.json
source_file = ui/app/i18n/clinical/locale_en.json
source_lang = en
type = KEYVALUEJSON
file_filter = ui/app/i18n/clinical/locale_<lang>.json
source_file = ui/app/i18n/clinical/locale_en.json
source_lang = en
type = KEYVALUEJSON
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:document-upload-app]
file_filter = ui/app/i18n/document-upload/locale_<lang>.json
source_file = ui/app/i18n/document-upload/locale_en.json
type = KEYVALUEJSON
minimum_perc = 0
resource_name = Document Upload App
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:home-app]
file_filter = ui/app/i18n/home/locale_<lang>.json
source_file = ui/app/i18n/home/locale_en.json
source_lang = en
type = KEYVALUEJSON
file_filter = ui/app/i18n/home/locale_<lang>.json
source_file = ui/app/i18n/home/locale_en.json
source_lang = en
type = KEYVALUEJSON
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:ipd-app]
file_filter = ui/app/i18n/ipd/locale_<lang>.json
source_file = ui/app/i18n/ipd/locale_en.json
type = KEYVALUEJSON
minimum_perc = 0
resource_name = IPD App
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:orders-app]
file_filter = ui/app/i18n/orders/locale_<lang>.json
source_file = ui/app/i18n/orders/locale_en.json
source_lang = en
type = KEYVALUEJSON
file_filter = ui/app/i18n/orders/locale_<lang>.json
source_file = ui/app/i18n/orders/locale_en.json
source_lang = en
type = KEYVALUEJSON
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:ot-app]
file_filter = ui/app/i18n/ot/locale_<lang>.json
source_file = ui/app/i18n/ot/locale_en.json
type = KEYVALUEJSON
minimum_perc = 0
resource_name = OT App
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:registration-app]
file_filter = ui/app/i18n/registration/locale_<lang>.json
source_file = ui/app/i18n/registration/locale_en.json
source_lang = en
type = KEYVALUEJSON
file_filter = ui/app/i18n/registration/locale_<lang>.json
source_file = ui/app/i18n/registration/locale_en.json
source_lang = en
type = KEYVALUEJSON
replace_edited_strings = false
keep_translations = false

[o:openmrs:p:bahmni:r:reports-app]
file_filter = ui/app/i18n/reports/locale_<lang>.json
source_file = ui/app/i18n/reports/locale_en.json
source_lang = en
type = KEYVALUEJSON
file_filter = ui/app/i18n/reports/locale_<lang>.json
source_file = ui/app/i18n/reports/locale_en.json
source_lang = en
type = KEYVALUEJSON
replace_edited_strings = false
keep_translations = false

1 change: 0 additions & 1 deletion ui/app/i18n/appointments/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"APPOINTMENT_SERVICE_SPECIALITY_KEY": "Speciality",
"PLACEHOLDER_SERVICE_SPECIALITY": "Select a speciality",
"APPOINTMENT_SERVICE_LOCATION_KEY": "Location",
"APPOINTMENT_ADDITIONAL_INFO": "Language",
"APPOINTMENT_SERVICE_LABEL_COLOUR_KEY": "Label Colour",
"PLACEHOLDER_SERVICE_LOCATION": "Select a location",
"APPOINTMENT_SERVICE_TYPE": "Service App. Type",
Expand Down

0 comments on commit a8bb471

Please sign in to comment.