Open TwistedTamarin opened 4 years ago
I am actually needing this to translate keys that are present in preferences.xml. I want to use localize for that too!
Hey! any plans to merge this?
This is the perfect fix for a problem I'm having, any plans on merging?
Hi there, in the current 5.0.4 version this feature is not working... any updates? Thanks!
@relez in case you want to try I have stopped using this plugin and wrote my own @nativescript-community/l
Hey @farfromrefug thanks for the plugin, I switched to your code and its working fine, one quick question, I have this code for Android platform in main.ts file:
import { androidLaunchEventLocalizationHandler } from '@nativescript-community/l';
I have an error that says that there is no such export. Does your plugin works without that code?
Quick question, I am using push notifications and I need to translate the incoming notifications, in the generated files Localizable.strings
(iOS for ex) I need to have a variable (%1$@) for the args coming in the notification message (body_loc_args), when that file is created from the i18n files, its rendered with double %% (%%1$@) and it does not work. Is there any way to avoid the generation of that file? Or maybe a way to escape the % and only print 1 instead of 2?
Thanks!
@relez if you have more question please ask on discord. Howeveer i ll answer it as it might help other peoples
The function has been renamed to overrideNativeLocale
for better understanding.
Now you need to know about the main difference in my plugin. My plugin is much faster if you something like this:
import { loadLocaleJSON } from '@nativescript-community/l';
const localeData = require(`~/i18n/${lang}.json`);
loadLocaleJSON(localeData);
What it does is NOT use the native way to translate keys. In nativescript-localize
every single call to localize
was going through native to get the translation. It is quite slow especially on android.
my plugin do it this way:
loadLocaleJSON
simply loaded from JS memoryThanks about tit
data loss prevention. (settings, facebookIds etc..)
In your default lang file add:
"protected" : { "exactId": "value" } example: "protected": { "fb_login_protocol_scheme": "xxx", "facebook_app_id": "xxx" }
Everything inside protected. will be added as is. thus keeping important strings inside strings.xml