-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localization does not work, without any error message. #87
Comments
Moved the i18n folder to be under src, instead of app (as I saw in some other clodes threads...) But now I get the following error: Followed up this error message, seems like this caused the error: NativeScript/nativescript-cli#3670 But this makes using this lib quite hard. |
I am having the same problem in nativescript-vue 6.3.2. The problems is that the Android "strings.xml" is not being updated when you compile the project. |
@KissBalazs You have to include 'app.name' property inside all of your translation files. 'app.name' will automatically update 'app_name' and 'title_activity_kimera'. |
I have the same issue.
I have imported the I'm using the UPDATE |
I use |
I'm afraid it's the same for me to. Using NativeScript 7.0.8 with a very simple TypeScript app. It's super frustrating; I've tried moving the i18n directory to the app root, to "src", tried renaming "src" to "app" (and updating appPath to "app" in webpack.config.js)... nothing and no error message either. It would be great to have some more verbal logging, I'm almost certain that language files are not loaded. |
I'm having exactly the same experience as @fodi |
Everyone, this repo is applicable for NativeScript 6. |
@dimitrisrk I changed the plugin to the NS7 Version and after restarting it actually showed me an error message about not finding the i18n folder. It wants it to be in 'src/i18n'. I moved the folder there and the error message disappeared. After restarting with "tns run" it partially works. I can now successfully call localize('user.name') and it returns the correct value. Any ideas? |
@jogotronic Unfortunately, I have very small experience with Vue apps. I think you should open an issue ticket in nativescript/plugins. |
For anyone ending up here after hours of frustration: In your packages.json' dependencies, Beware of the package name - the latter is a scoped package living under the main nativescript repo. The problem is resolved for me after replacing the package. |
If it's still not working, run |
I still can't make it work. What I've done so far:
The result is a log line with "app.name" instead of the label translated. Am I missing any step? EDIT Just in case someone is having the same issue and reaches here. |
I have just finished the install process:
But if I try to translate any string, it simply won't work.
Both in TS code (app.component.ts):
or in template:
<Label text="{{ 'test' | L }}"></Label>
does only returns "test" instead of the translated value.The text was updated successfully, but these errors were encountered: