kelvinhokk / cordova-plugin-localization-strings

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

Custom TRANSLATION_PATH not working or ignored #57

Open Reqven opened 4 years ago

Reqven commented 4 years ago

I have the following default path in the packages.json file.

"cordova-plugin-localization-strings": {
  "TRANSLATION_PATH": "translations/app/"
}

Any other path seems to be ignored. Therefore, translations are not found/copied over when building the app.

Any idea about this ? Thanks

rodrigograca31 commented 4 years ago

Just gave it a quick look and the code actually looks a bit bad. :sob:

Repeated code (android/ios), bad if/else statements, variable values being assigned twice in a row, imports in the middle of the code, etc

https://github.com/kelvinhokk/cordova-plugin-localization-strings/commit/bd850754bb69453795d2e8e4da3a98fc89400c75

Doesn't look good on me talking shit about this code but its true.... This could use quite a good amount of improvement. Unfortunately I dont have the time currently. You can always try to solve it on your own or create a bounty for someone to solve it: https://www.bountysource.com/

miqmago commented 4 years ago

I've been able to make it work like this:

    <plugin name="cordova-plugin-localization-strings" spec="~3.2.1">
        <variable name="TRANSLATION_PATH" value="resources/native-translations/" />
    </plugin>
SumeetHindinkeri commented 4 years ago

@rodrigograca31 @miqmago I am working on ionic 4 project.I used this plugin and also followed the steps mentioned in readme.I also used comment mentioned above by @miqmago but nothing worked for me.It did not create any "/Resources/es.lproj/Localizable.strings" files at given path.I am trying to use this plugin for localising strings in dutch and english for NSCameraUsageDescription and other info.plist strings.Can anybody help me out !