cordova-plugin-localization-strings icon indicating copy to clipboard operation
cordova-plugin-localization-strings copied to clipboard

Custom TRANSLATION_PATH not working or ignored

Open Reqven opened this issue 5 years ago • 3 comments

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

Reqven avatar Feb 21 '20 13:02 Reqven

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/

rodrigograca31 avatar Feb 26 '20 23:02 rodrigograca31

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>

miqmago avatar Apr 26 '20 17:04 miqmago

@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 !

SumeetHindinkeri avatar May 07 '20 06:05 SumeetHindinkeri