Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Languages for Phonegap Application

Does anyone have experience to build phonegap app that support multiple languages (english, french, german etc...) ? I'm looking a way to change ui of my app most efficent with javascript. It would be helpful when you can show me any existing javascript libs that can help me to do this.

Thanks

Edited:

i edited the question so that it's more understandable.

like image 399
Peacemoon Avatar asked Mar 12 '26 16:03

Peacemoon


2 Answers

Depending on the language preference:

http://docs.phonegap.com/en/2.2.0/cordova_globalization_globalization.md.html#globalization.getPreferredLanguage

Redirects to the correct page

like image 81
Dario Avatar answered Mar 16 '26 05:03

Dario


Assuming you are talking about spoken languages here, you just need to replace all your hard coded strings in your HTML such that they they are inserted during a templating phase and looked up in a table of string values, which table to string values that is used can be determined by what language the application is operating in. There was a good article on this topic on 24ways a while back, check it out here. The article is for JavaScript so it certainly applies for a PhoneGap application.

like image 45
davejohnson Avatar answered Mar 16 '26 04:03

davejohnson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!