Open kefahB opened 4 years ago
Hi @shiv19, what do you think about this ?
Interesting idea. So we could technically also add new localisation strings on the fly. Instead of using the switch case, we could do something like this,
let value;
while(splits.length) {
value = parser.value(data[splits.shift()]);
}
That way it can handle any length of splits :) Not sure of the performance implications though. It would be worth stress testing this on a large application.
Yes of cours :-D
Hi @EddyVerbruggen,
I use currently this plugin on my prod App, since we can not edit the
Resources
file and the translate wont be affected by the update. I've thought about how we can update thetext
or thetranslate
on the app. I have done a little test, it work but I dont know how much it is a good solution !!The idea is : On the
nativescript-app-sync
side : add a new optionssyncWithNsLocalize
if it is set, create new boolean on the application settings__SYNC_NS_LOCALIZE__
On the
nativescript-localize
side : 1- if__SYNC_NS_LOCALIZE__
is set, we will import the json file__app__language__.json
intolocalize.android.ts
andlocalize.ios.ts
2- Override the string if the value that come from the json file dont match with the value from the resources fileI know the parser it is bizarre but I haven't thought about it yet if there is a better way to achieve this