-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implemented conversions between JSON and Xcode files #7
Conversation
Added the current localizations fetched from the iOS repo to the existing JSON files
Implemented a script that converts .xcstrings files to .json files. The JSON files use the template: "key" : { "translation" : "translationValue", "comment" : "commentValue" } It requires the "requests" library to fetch the string catalog directly from the Scribe-iOS repo (there may be a better implementation of this)
Implemented a script that converts .json files to one .xcstrings file. It assumes that translated entries are already reviewed. todo: Needs to be an automated process, maybe automatic PRs for Scribe-iOS whenever a JSON file in Scribe-i18n changes.
This reverts commit d452419. Translations will be provided when they're finalized
New design puts the xcstrings file in the main directory, can be changed later
Thank you for the pull request!The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) If you're not already a member of our public Matrix community, please consider joining! It'd be great to have you! Maintainer checklist
|
Adjusted the conversion because missing localizations would display as empty strings instead of key placeholders
This reverts commit 3de1788. The changes broke compatibility with converting the xcstrings file back to python, instead the key now *is* the translated text to make sure it gets used as a placeholder.
The script is now in line with the idea that the Xcode string catalog will be in the Scribe-i18n directory. Unused translations have also been removed for now, so that users won't be able to select languages without any translations.
- Changed name of scripts to say 'xcstrings' instead of 'swift' - Added GitHub action that executes the conversion script to xcstrings as soon as a change to the JSON files gets pushed to the repo
- Added back previously removed JSON files - JSONs will now work as agreed: simply key : value pairs - xcstrings file now only has the most necessary info; both to simplify and shrink it, and to make sure missing translations get rendered with default values instead of empty strings or keys
8e92e5b
to
13c9ced
Compare
runs-on: ubuntu-latest | ||
needs: | ||
- conditional_job_check_files | ||
if: needs.conditional_job_check_files.outsputs.json_changed == 'True' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking, but this should be outputs
- i.e. extra s in the middle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was showing me an error on my end :)
Scribe-i18n/pt.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do need pt.json
for the Portuguese localization :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's look at this a bit more on Saturday, @Jag-Marcel! :) I did fix the minor things that I talked about in the comments. Let's discuss what we want the key naming criteria to be as a group, but feel free to start preparing the localization process in iOS as you see fit :)
Would be great if you'd present this, if you're comfortable 😊 |
Yes, I can present this at the next sync |
@wkyoshida it looks like the changes here aren't automatically updated in the Scribe-iOS subtree, could you sync them when you have the time? |
Description
This PR implements python scripts to convert between JSON files and Xcode's .xcstrings string catalogs and adds the current localizations from the iOS app to the existing JSONs.