- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to find a way to create an APP to be used in several languages. Is there any plugin or tutorial to do it?
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are several Javascript libraries for this. Google brings up a bunch.
Before you start it, identify your needs:
- do you need to localize dates? ( today is 7/10/2015 in the US, but 10-07-2015 in England)
- do you need to localize numbers? ( my step counter shows that I've taken 2,400 steps here in the US, but in England that would be 2.400 )
- currency? ($ vs € )
- do you have compound or format strings? ("Put your " + pet_name + "into the cage"; "Ensure the leash to %s is secure")
- are you worried about handling plurals or possessives?
- are the strings you need localized in the HTML, or the Javascript, or the CSS (via :content pseudo selectors), or all of the above?
- will you be wanting to auto-detect the language via the OS/browser, or do you want the user to select it themselves?
- Do you care about regional differences? ( "color" vs "colour", "gas" vs "petrol" )
The easiest libraries to use generally have fewer features. The full featured libraries usually require more rigamarole.
Typically, you'll have a big JSON file of identifiers and strings. One file for each language, and maybe an auxillary file for locale specializations. My favorite localization methods use readable english strings as the identifier. Much easier to work with:
English JSON:
{"Hello Friend":"Hello Friend", "Goodbye":"Goodbye"}
Spanish JSON:
{"Hello Friend":"Hola Amigo", "Goodbye":"Chau"}
But some use javascript variable name rules
{"greeting_1":"Hello Friend", "goodbye_2":"Goodbye"}
Some libraries let you localize HTML by simply putting a class on a tag;
<p class="localize">Hello Friend</p>
But others require you to process everything with code.
Good luck,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. I will search in Google for these solutions.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page