custom resource path
Opened this issue · 8 comments
@rborn Please allow us to pass a I18n source folder path when requiring the plugin so that we can have it follow our own directory conventions instead of having to use a hardcoded path; thank you (:
@vbresults could you give me more details on what you need? thank you
@rborn source path is hardcoded to app/i18n
This suggestion is to amend this, so that while by default it is still app/i18n, it can be changed, like so:
require("nativescript-i18n")({
path: "resources/i18n"
});
// searches 'app/resources/i18n' for source strings instead of 'app/i18n'
@vbresults Not sure how to achieve this, there is a before-build hook that creates the iOS strings before the app it's built, so we need to know beforehand the path of the files :(
A way would be to try to set something in package.json but I'm not sure if this approach it's good and/or possible.
@vbresults please have a look in the custom_lang_path branch.
To set the custom path you need to alter your project's package.json
file like in the demo app and of course to move the file in the new path.
Keep in mind that the new path is relative to the app's root.
Play with it and let me know, and once it's fine I'll merge it and push it to npm 😄
@rborn Thank you; is there any chance for it to follow this spec? NativeScript/NativeScript#2609
@vbresults so you'd like to have the i18n folder inside the app/App_Resources
folder? Or am I getting it wrong?
@rborn Edit: Your package.json idea is better, will try it out