From a8bb471ef0d78664dc514e2e7e1af2ecea69f4ae Mon Sep 17 00:00:00 2001 From: Rahul Ramesh <121226043+rahu1ramesh@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:50:20 +0530 Subject: [PATCH] BAH-3002 | Add. Script To Push Translations To Transifex * [Parvathy, Rahul] | BAH-3002 | Add. Script To Push Translations to Transifex Co-authored-by: Parvathy Babu * [Parvathy, Rahul] | BAH-3002 | Add. Resource To Transifex Config Co-authored-by: Parvathy Babu --------- Co-authored-by: Parvathy Babu --- .github/scripts/transifex.sh | 26 ++++++ .github/workflows/build_publish.yml | 5 ++ .tx/config | 107 +++++++++++++++++------- ui/app/i18n/appointments/locale_en.json | 1 - 4 files changed, 110 insertions(+), 29 deletions(-) create mode 100755 .github/scripts/transifex.sh diff --git a/.github/scripts/transifex.sh b/.github/scripts/transifex.sh new file mode 100755 index 0000000000..d096e493f1 --- /dev/null +++ b/.github/scripts/transifex.sh @@ -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 diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml index 956b0990c0..fbdfbfc0f3 100644 --- a/.github/workflows/build_publish.yml +++ b/.github/workflows/build_publish.yml @@ -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 diff --git a/.tx/config b/.tx/config index 1f9b009ae0..bccdf7354e 100644 --- a/.tx/config +++ b/.tx/config @@ -2,43 +2,94 @@ host = https://www.transifex.com [o:openmrs:p:bahmni:r:admin-app] -file_filter = ui/app/i18n/admin/locale_.json -source_file = ui/app/i18n/admin/locale_en.json -source_lang = en -type = KEYVALUEJSON +file_filter = ui/app/i18n/admin/locale_.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_.json -source_file = ui/app/i18n/adt/locale_en.json -source_lang = en -type = KEYVALUEJSON +file_filter = ui/app/i18n/adt/locale_.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_.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_.json -source_file = ui/app/i18n/clinical/locale_en.json -source_lang = en -type = KEYVALUEJSON +file_filter = ui/app/i18n/clinical/locale_.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_.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_.json -source_file = ui/app/i18n/home/locale_en.json -source_lang = en -type = KEYVALUEJSON +file_filter = ui/app/i18n/home/locale_.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_.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_.json -source_file = ui/app/i18n/orders/locale_en.json -source_lang = en -type = KEYVALUEJSON +file_filter = ui/app/i18n/orders/locale_.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_.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_.json -source_file = ui/app/i18n/registration/locale_en.json -source_lang = en -type = KEYVALUEJSON +file_filter = ui/app/i18n/registration/locale_.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_.json -source_file = ui/app/i18n/reports/locale_en.json -source_lang = en -type = KEYVALUEJSON +file_filter = ui/app/i18n/reports/locale_.json +source_file = ui/app/i18n/reports/locale_en.json +source_lang = en +type = KEYVALUEJSON +replace_edited_strings = false +keep_translations = false + diff --git a/ui/app/i18n/appointments/locale_en.json b/ui/app/i18n/appointments/locale_en.json index 77f48cf858..13e2330d1d 100644 --- a/ui/app/i18n/appointments/locale_en.json +++ b/ui/app/i18n/appointments/locale_en.json @@ -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",