nativescript-localize
nativescript-localize copied to clipboard
Comptibility with Nativescript 6.0.1
I've installed nativescript-localized as noted in the installation instructions.
However, localization does not work as expected.
Version information:
✔ Getting NativeScript components versions information...
✔ Component nativescript has 6.0.1 version and is up to date.
✔ Component tns-core-modules has 6.0.1 version and is up to date.
✔ Component tns-android has 6.0.0 version and is up to date.
✔ Component tns-ios has 6.0.1 version and is up to date.
Any help would be appreciated.
Hi @lepokle Can you elaborate as to how it isn't working as expected?
Hello together, I have the same issue here. Cannot get the plugin working with 6.0.1. The key string to be translated is returned rather than the translated version of it.
In localize.android.ts the returned identifier from getStringId = 0. I added the plugin to app.module.ts and added the i18n folder to app folder. My en.default.json file looks as follows: { "app.name": "My app", "strHello": "Hello World" }
export function localize(key: string, ...args: string[]): string { let localizedString; try { const identifier = utils.ad.resources.getStringId(encodeKey(key)); localizedString = identifier === 0 ? key : getResources().getString(identifier); } catch (error) { localizedString = key; } return vsprintf(localizedString, args); }
Update, if I move the i18n folder from app to src than the strings are detected and the plugin works as expected
Update, if I move the i18n folder from app to src than the strings are detected and the plugin works as expected
Thank you it's work
@EddyVerbruggen can you update readme please ?