EddyVerbruggen / nativescript-localize

Internationalization plugin for NativeScript using native capabilities of each platform
MIT License
79 stars 31 forks source link

Avoid changing Info.plist #60

Closed abhayastudios closed 5 years ago

abhayastudios commented 5 years ago

First of all thanks for creating this plugin. Started using it just now and seems to be an easy and elegant solution.

The only thing that I have a problem with so far is that the plugin (I guess the hooks) are changing the contents of my Info.plist file in such a way that it removes any comments etc. Is there any way this can be avoided? Why does it need to be rewritten? If it is absolutely necessary, is it not possible to write the Info.plist file to the platforms/ios dir directly and leave the original intact?

In addition there are also the files App_Resources/iOS/<language code>.lproj/* that are generated during the run, which in my opinion could/should also be created only in the platforms/ios dir in order to avoid having to commit those in git after each change (although for now I just added them to the .gitignore file, so less important).

Thanks!

lfabreges commented 5 years ago

Info.plist is modified to change the default title and language of the application. I don't know if by modifying the file directly in the platform directory before the actuel build would work. I won't take the time to try it, but I'll gladly test and merge a PR.

abhayastudios commented 5 years ago

@lfabreges after some more consideration I decided to use a custom hook that runs before this plugin's hook that copies the "original" Info.plist from an "environments" directory. I think it easiest this way and also it doesn't meddle with default iOS prepare/build process. Thanks!