Closed AbhishekJoshi closed 5 years ago
@kelvinhokk poke poke.
I'd like to accept this PR but I see too many "confusing" changes.... I will have to look further into them and see if everything looks "right"
But I do like the TRANSLATION_PATH
idea, since the first time I used the plugin also thought it was strange to use a specific folder, also that makes me have my translations twice in the project... but this PR wont fully solve that because the JSON format is different if I remember correctly....
I spent hours on this just to have a clean history with only the specific commit!
PR #44 does it so I'm closing this one. Thanks for your contribu @AbhishekJoshi
This will allow the usage of a command like:
cordova plugin add .... --fetch --variable TRANSLATION_PATH=""
TRANSLATION_PATH
will become a value in yourconfig.xml
.I default to the existing
translations/app/
if the value passed is null, blank/whitespace. I handle cases like""
," "
, and the actual real path we look for which should be any path in your Cordova project.Example usage:
cordova plugin add .... --fetch --variable TRANSLATION_PATH="src/assets/native_translations/"
Value
TRANSLATION_PATH
must end with a/
like above.This PR fulfills a bit of an awkwardness around the fact many apps tend to keep translations in one place.
Please let me know if you have any questions or need me to change anything. @kelvinhokk