kelvinhokk / cordova-plugin-localization-strings

Cordova Plugin for Localization of Strings on the App
MIT License
119 stars 106 forks source link

Set a path for the plugin to find the Translations in #22

Closed AbhishekJoshi closed 5 years ago

AbhishekJoshi commented 6 years ago

This will allow the usage of a command like:

cordova plugin add .... --fetch --variable TRANSLATION_PATH=""

TRANSLATION_PATH will become a value in your config.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

Chuckv01 commented 6 years ago

@kelvinhokk poke poke.

rodrigograca31 commented 5 years ago

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"

rodrigograca31 commented 5 years ago

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....

rodrigograca31 commented 5 years ago

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