Hi, I have two questions to ask: 1- Do you know any apps in iOS where user can change the language ?
2- I have two language for my apps English and French i'm managing it with the L() function and it works well. I want to allow the user to change the apps language, I found a solution for that it works after the resetting the apps. Is there a solution to change language inside the apps (rest the apps..) ?
here is my code:
// app.js (function() { if(Ti.App.Properties.getString('lang') == 'undefined') { if(Titanium.Locale.getCurrentLanguage() == 'fr') { Ti.App.Properties.setString('lang', 'fr'); } else { Ti.App.Properties.setString('lang', 'en'); } } else { Ti.App.Properties.setString('lang', Ti.App.Properties.getString('lang')); } var winLogin = require('ui/winLogin').createWindow(); winLogin.open(); })();
// language page // a picker with fr and en to chose a language //event on done button done.addEventListener('click',function() { Ti.App.Properties.setString('lang', picker.getSelectedRow(0).value); pickerView.animate(slideOut); });
1 Answer
The L function works by itself based on the phone settings. I don't think honestly that anyone would want to change the app's language while running, but if you still want this, you ill have to reset every single UI that holds text in your app by hand.
It would be a nightmare but it should work.
Your Answer
Think you can help? Login to answer this question!