-
Notifications
You must be signed in to change notification settings - Fork 12
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
Convert and copy all translations at build time #14
Conversation
Before merging this PR, I’d like to merge #13, which fixes the CocoaPods podspec. |
The conversion script now updates the submodule and copies the plists into the built product bundle. Every available language is copied. Deleted the checked-in instructions plists in favor of a Run Script build phase that runs this script. Also run the script as a preflight command in the podspec for CocoaPods users. Deleted the separate scheme that ran the script, now that everything is automatic.
This PR also pulls in Project-OSRM/osrm-text-instructions@b4c5187. All in all, the following languages have been added:
|
The CocoaPods podspec linter is erroring out because the
Some of the changes to the conversion script in 7f2eadc will need to be conditionalized: in Xcode (for Carthage), the files would be written into the build product; when run standalone (for CocoaPods), the files would be written to an easily accessed location, such as under OSRMTextInstructions/*.lproj/. |
When the conversion script is run standalone, as CocoaPods does, put the plists under the source directory, since the build products directory is unknown.
ef3fdec fixes the CocoaPods installation error. |
json2plist.sh
Outdated
LANGUAGE=${LANGUAGE%.json} | ||
fi | ||
|
||
if [ "$LANGUAGE" != "skip" ]; then |
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.
when will language ever be skip
?
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.
Good catch. That can be removed.
I'm good with this approach. The only downside I see is that the git submodule checked into .git as part of osrm-text-instructions.swift will over time very much fall behind. This may be confusing for users, given that they see a submodule that is not actually used. Instead, it might make sense to the submodule only in |
On second thought I think this PR is a bad idea. When we do structural changes on the language files in I understand that the premise of this PR is to speed-up the process of changes in Transifex being available in |
The risk associated with structural changes upstream should be no different than it is now on master. Note that |
@freenerd, as a case in point, if you run the script in this PR, you’ll wind up with Project-OSRM/osrm-text-instructions@b4c5187, not the latest master (currently Project-OSRM/osrm-text-instructions@6a57291). Also, to clarify, the point of this PR is to avoid having to PR changes to checked-in plists. A PR is still required to get new translations, but such PRs will only require changes to the submodule pin, as was the case with acea632. |
@1ec5 thanks for the clarification, this makes sense. |
Yay! By the way, the build failures are because .travis.yml won’t exist until #17 lands, but Travis (unlike Bitrise) insists that the file has to exist on every branch simultaneously. Only a temporary inconvenience. |
This PR improves the process of producing the project’s plists, preventing us from having to push PRs for each change to translations in the main osrm-text-instructions repository. Also, every language included by osrm-text-instructions is also included in this port.
A script that runs as part of the build (for Carthage users) or as a preflight step (for CocoaPods users) updates the submodule, converts the translation JSON files into plist format, then copies the plists into the built product bundle. The checked-in instructions plists have been deleted, since they can be regenerated on each build.
Fixes #10.
/cc @bsudekum @frederoni