Closed felixkrautschuk closed 4 years ago
you should put i18n
folder inside app
folder not inside app/resources
did you change appResourcesPath
in nsconfig
?
plugin should use your custom paths
[SOLVED]
i have the same issue...
this is my nsconfig.json
{ "appResourcesPath": "App_Resources", "appPath": "src" }
i put i18n dir in the app folder but it didn't work, then i put it like this: but also didn't work...
what i'm wrong?
Thanks...
SOLUTION: debuggin the pre-hook script in the plugin i find the solution,
the plugin look the folder named "/app/i18n" by default,
adding this in the pakage.json:
"nativescript-i18n": { "customLangPath": "src/i18n", "defaultLang": "it" }
and putting the i18n folder in the "{rootProjectFolder}/src/i18n"
it work and generate the file correctly.
Environment:
According to the docs of this plugin, one should create an i18n folder in the app directory like this:
On my side, this folder has no effect, even when I'm defining a custom path for those resources and setting them in package.json, like it is done in the demo app, the language resources are not loaded. I'm not seeing any errors in the logs, but I also do not see the correct languages (only the keys like 'hello_world',...) on Android and iOS.
The only way to make languages working is defining them in the native App_Resources folders, so for Android:
and for iOS:
When I use the demo app of this repository, I can remove the app/resources/i18n folder and I get no error, as it seems that only the native language resources are used (on both Android and iOS).
Am I doing something completely wrong or are the docs not up-to-date?