Closed santteegt closed 5 years ago
@santteegt I've faced same problem try to move you i18n folder one level up
src --app --i18n ----de.js ----en.default.js
and it works for me
It worked! Thanks @ibenzyk
@ibenzyk thanks! It worked for me too. But shouldn't this thing be kinda said in the README @lfabreges?
@EddyVerbruggen @breningham , I am not able to change the language with in the app.
I am using Nativescript with angular.
I created i18n directory under src folder, when i try to change the language, based on the documentation https://market.nativescript.org/plugins/nativescript-localize here for angular,
es.default.json: { "Hello": "Hello", "app_name": "My app", "title_activity_kimera": "My app", }
hi.json: { "Hello": "नमस्कार", "app_name": "My app", "title_activity_kimera": "My app" }
Following things i imported in angular component:
import { android as _android } from '@nativescript/core/application'; import { overrideLocale } from 'nativescript-localize/localize'; import { isAndroid } from 'tns-core-modules/platform';
function which i call when user tries to change the language:
switchLanguage(selectedLang){ L.localize.overrideLocale(selectedLang); if (isAndroid) { _android.foregroundActivity.finish(); } }
Here in the function, it sasy 'L' is not defined. Any help would be appreciated. Thanks.
Hi,
I'm trying to use your library on an app but the string is not being localized.
I'm importing the
NativeScriptCommonModule
on a shared module:Then on the component's module I'm importing this SharedModule:
And, on the component HTML template, I'm using the
L
pipe as follows:My i18n directory structure is:
app --i18n ----de.js ----en.default.js
The
en.default.js
contains:Dependencies version
What could be the problem? Does the
app.name
should have the specific name for the nativescript app project I created?