From aafa0f6b7d8fbd64e0fe43f56523450204fbf21c Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Thu, 15 Aug 2024 23:20:20 +0200 Subject: [PATCH] #37 update Scribe-i18n structure and fix conversion workflow --- .github/workflows/json_conversion.yml | 6 +++--- README.md | 2 +- Scribe-i18n/{ => jsons}/de.json | 0 Scribe-i18n/{ => jsons}/en-US.json | 0 Scribe-i18n/{ => jsons}/es.json | 0 Scribe-i18n/{ => jsons}/fr.json | 0 Scribe-i18n/{ => jsons}/pt.json | 0 Scribe-i18n/{ => jsons}/ru.json | 0 Scribe-i18n/{ => jsons}/sv.json | 0 .../Android/convert_jsons_to_strings.py | 2 +- .../{Scripts => scripts}/Android/convert_strings_to_json.py | 2 +- .../{Scripts => scripts}/iOS/convert_jsons_to_xcstrings.py | 2 +- .../{Scripts => scripts}/iOS/convert_xcstrings_to_jsons.py | 2 +- 13 files changed, 8 insertions(+), 8 deletions(-) rename Scribe-i18n/{ => jsons}/de.json (100%) rename Scribe-i18n/{ => jsons}/en-US.json (100%) rename Scribe-i18n/{ => jsons}/es.json (100%) rename Scribe-i18n/{ => jsons}/fr.json (100%) rename Scribe-i18n/{ => jsons}/pt.json (100%) rename Scribe-i18n/{ => jsons}/ru.json (100%) rename Scribe-i18n/{ => jsons}/sv.json (100%) rename Scribe-i18n/{Scripts => scripts}/Android/convert_jsons_to_strings.py (95%) rename Scribe-i18n/{Scripts => scripts}/Android/convert_strings_to_json.py (95%) rename Scribe-i18n/{Scripts => scripts}/iOS/convert_jsons_to_xcstrings.py (95%) rename Scribe-i18n/{Scripts => scripts}/iOS/convert_xcstrings_to_jsons.py (95%) diff --git a/.github/workflows/json_conversion.yml b/.github/workflows/json_conversion.yml index b3640a2..270978e 100644 --- a/.github/workflows/json_conversion.yml +++ b/.github/workflows/json_conversion.yml @@ -5,7 +5,7 @@ on: branches: - main paths: - - 'Scribe-i18n/**.json' + - "Scribe-i18n/jsons/**.json" jobs: # Run JSON to app strings conversion scripts if needed. @@ -18,5 +18,5 @@ jobs: python-version: 3.12 - name: Execute script to convert JSON to string files run: | - python ./Scripts/Android/convert_jsons_to_strings.py - python ./Scripts/iOS/convert_jsons_to_xcstrings.py + python scripts/android/convert_jsons_to_strings.py + python scripts/ios/convert_jsons_to_xcstrings.py diff --git a/README.md b/README.md index b630ce1..420cac2 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ If all looks good, then you're ready to start adding localizable key-string pair ### File Conversion -The files in the [Scribe-i18n/Scripts](https://github.com/scribe-org/Scribe-i18n/tree/main/Scribe-i18n/Scripts) directory can be used to convert base localization JSON files into the filetypes that are needed for an application as well as the same in reverse. JSON files are automatically converted to their target files for Scribe applications after commits to the main branch, and their opposites can be used to update the JSON files when strings are first changed in the applications. +The files in the [Scribe-i18n/scripts](https://github.com/scribe-org/Scribe-i18n/tree/main/Scribe-i18n/scripts) directory can be used to convert base localization JSON files into the filetypes that are needed for an application as well as the same in reverse. JSON files are automatically converted to their target files for Scribe applications after commits to the main branch, and their opposites can be used to update the JSON files when strings are first changed in the applications. ### Adding Scribe-i18n to Projects [`⇧`](#contents) diff --git a/Scribe-i18n/de.json b/Scribe-i18n/jsons/de.json similarity index 100% rename from Scribe-i18n/de.json rename to Scribe-i18n/jsons/de.json diff --git a/Scribe-i18n/en-US.json b/Scribe-i18n/jsons/en-US.json similarity index 100% rename from Scribe-i18n/en-US.json rename to Scribe-i18n/jsons/en-US.json diff --git a/Scribe-i18n/es.json b/Scribe-i18n/jsons/es.json similarity index 100% rename from Scribe-i18n/es.json rename to Scribe-i18n/jsons/es.json diff --git a/Scribe-i18n/fr.json b/Scribe-i18n/jsons/fr.json similarity index 100% rename from Scribe-i18n/fr.json rename to Scribe-i18n/jsons/fr.json diff --git a/Scribe-i18n/pt.json b/Scribe-i18n/jsons/pt.json similarity index 100% rename from Scribe-i18n/pt.json rename to Scribe-i18n/jsons/pt.json diff --git a/Scribe-i18n/ru.json b/Scribe-i18n/jsons/ru.json similarity index 100% rename from Scribe-i18n/ru.json rename to Scribe-i18n/jsons/ru.json diff --git a/Scribe-i18n/sv.json b/Scribe-i18n/jsons/sv.json similarity index 100% rename from Scribe-i18n/sv.json rename to Scribe-i18n/jsons/sv.json diff --git a/Scribe-i18n/Scripts/Android/convert_jsons_to_strings.py b/Scribe-i18n/scripts/Android/convert_jsons_to_strings.py similarity index 95% rename from Scribe-i18n/Scripts/Android/convert_jsons_to_strings.py rename to Scribe-i18n/scripts/Android/convert_jsons_to_strings.py index 3afc48a..1612f4e 100644 --- a/Scribe-i18n/Scripts/Android/convert_jsons_to_strings.py +++ b/Scribe-i18n/scripts/Android/convert_jsons_to_strings.py @@ -2,7 +2,7 @@ Converts from Scribe-i18n localization JSON files to string.xml files. Usage: - python3 Scribe-i18n/Scripts/Android/convert_jsons_to_strings.py + python3 Scribe-i18n/scripts/android/convert_jsons_to_strings.py """ import os import json diff --git a/Scribe-i18n/Scripts/Android/convert_strings_to_json.py b/Scribe-i18n/scripts/Android/convert_strings_to_json.py similarity index 95% rename from Scribe-i18n/Scripts/Android/convert_strings_to_json.py rename to Scribe-i18n/scripts/Android/convert_strings_to_json.py index db276bb..75b1cc6 100644 --- a/Scribe-i18n/Scripts/Android/convert_strings_to_json.py +++ b/Scribe-i18n/scripts/Android/convert_strings_to_json.py @@ -2,7 +2,7 @@ Converts from string.xml files to Scribe-i18n localization JSON files. Usage: - python3 Scribe-i18n/Scripts/Android/convert_strings_to_json.py + python3 Scribe-i18n/scripts/android/convert_strings_to_json.py """ import os diff --git a/Scribe-i18n/Scripts/iOS/convert_jsons_to_xcstrings.py b/Scribe-i18n/scripts/iOS/convert_jsons_to_xcstrings.py similarity index 95% rename from Scribe-i18n/Scripts/iOS/convert_jsons_to_xcstrings.py rename to Scribe-i18n/scripts/iOS/convert_jsons_to_xcstrings.py index ffac001..d3236f3 100644 --- a/Scribe-i18n/Scripts/iOS/convert_jsons_to_xcstrings.py +++ b/Scribe-i18n/scripts/iOS/convert_jsons_to_xcstrings.py @@ -3,7 +3,7 @@ Usage: - python3 Scribe-i18n/Scripts/iOS/convert_jsons_to_xcstrings.py + python3 Scribe-i18n/scripts/ios/convert_jsons_to_xcstrings.py """ import json diff --git a/Scribe-i18n/Scripts/iOS/convert_xcstrings_to_jsons.py b/Scribe-i18n/scripts/iOS/convert_xcstrings_to_jsons.py similarity index 95% rename from Scribe-i18n/Scripts/iOS/convert_xcstrings_to_jsons.py rename to Scribe-i18n/scripts/iOS/convert_xcstrings_to_jsons.py index e3fd3a8..4aab089 100644 --- a/Scribe-i18n/Scripts/iOS/convert_xcstrings_to_jsons.py +++ b/Scribe-i18n/scripts/iOS/convert_xcstrings_to_jsons.py @@ -2,7 +2,7 @@ Converts from the Scribe-i18n Localizable.xcstrings file to localization JSON files. Usage: - python3 Scribe-i18n/Scripts/iOS/convert_xcstrings_to_jsons.py + python3 Scribe-i18n/scripts/ios/convert_xcstrings_to_jsons.py """ import json