From 33ab10afca0797ace7608a9ae83eb31949b22bc0 Mon Sep 17 00:00:00 2001 From: Omar Al-Ithawi Date: Thu, 16 May 2024 19:50:39 +0300 Subject: [PATCH] feat: add mobile apps with support for pre-extract step --- .../extract-translation-source-files.yml | 23 +++++++++++++++++-- transifex.yml | 16 +++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.github/workflows/extract-translation-source-files.yml b/.github/workflows/extract-translation-source-files.yml index c2590ee2176..7a80161f8c0 100644 --- a/.github/workflows/extract-translation-source-files.yml +++ b/.github/workflows/extract-translation-source-files.yml @@ -95,7 +95,19 @@ jobs: const allGenericRepos = [ { repo: 'tutor-contrib-aspects', - transifex_file_path: 'transifex_input.yaml' + transifex_file_path: 'transifex_input.yaml', + }, + { + repo: 'openedx-app-ios', + transifex_file_path: 'I18N/I18N/en.lproj/Localizable.strings', + before_extract: 'make translation_requirements', + ref: 'develop', // TODO: Use main branch https://github.com/openedx/openedx-translations/issues/6395 + }, + { + repo: 'openedx-app-android', + transifex_file_path: 'i18n/src/main/res/values/strings.xml', + before_extract: 'make translation_requirements', + ref: 'develop', // TODO: Use main branch https://github.com/openedx/openedx-translations/issues/6395 }, ] @@ -404,7 +416,7 @@ jobs: uses: actions/checkout@v3 with: repository: ${{ github.repository_owner }}/${{ matrix.repository_config.repo }} - ref: ${{ github.event.inputs.ref }} + ref: ${{ github.event.inputs.ref || matrix.repository_config.ref }} path: translations/${{ matrix.repository_config.repo }} # Sets up Python @@ -417,6 +429,13 @@ jobs: - name: install requirements run: pip install -r requirements/translations.txt + - name: run optional pre-extraction step + if: "${{ matrix.repository_config.before_extract }}" + run: | + # If the repository has additional requirements or processing steps run them + cd translations/${{ matrix.repository_config.repo }} + ${{ matrix.repository_config.before_extract }} + # Extracts the translation source files - name: extract translation source files run: | diff --git a/transifex.yml b/transifex.yml index 3523b5eff4a..5af3e4a182d 100644 --- a/transifex.yml +++ b/transifex.yml @@ -303,6 +303,22 @@ git: source_file_dir: translations/platform-plugin-aspects/platform_plugin_aspects/conf/locale/en/ translation_files_expression: 'translations/platform-plugin-aspects/platform_plugin_aspects/conf/locale//' + # openedx-app-android + - filter_type: file + file_format: ANDROID + source_file_extension: strings + source_language: en + source_file_dir: translations/openedx-app-android/i18n/src/main/res/values/strings.xml + translation_files_expression: 'translations/openedx-app-android/i18n/src/main/res/values-/strings.xml' + + # openedx-app-ios + - filter_type: file + file_format: STRINGS + source_file_extension: strings + source_language: en + source_file_dir: translations/openedx-app-ios/I18N/I18N/en.lproj/Localizable.strings + translation_files_expression: 'translations/openedx-app-ios/I18N/I18N/.lproj/Localizable.strings' + # RecommenderXBlock - filter_type: dir file_format: PO