Multilingual Apps with jQuery Mobile
is there a standardized way to create jQuer开发者_StackOverflow社区y Mobile Apps (with Phonegap) in multiple languages?
Here is the link that you can use for using multiple languages in your app. I don't have a working example right now but I think it will work fine in case of jQuery mobile without problem.
In case someone has the same question... I found the microsoft solution from "lakhlaniprashant.blogspot.com" not very helpful. But thanks anyways ;-)
I wrote my own localization function with javascript and json.
in my case my webapp is developed with jquerymobile and php, so i have 1 php file for every lang i want to support.
example:
if the user has configured his language as english i include on my header the English.php if the user uses spanish i include the spanish.php:
english.php:
<?php
$sentence="this is a sentence";
?>
spanish.php
<?php
$sentence="esto es una frase";
?>
if you "echo $sentence" it will take the one from the file you included. I store the selected language in a cookie and include the proper language file.
精彩评论