Software Archive
Read-only legacy content
17060 Discussions

Globalization: Is there any plugin ou tutorial to create an APP multilingual?

Hamilton_Tenório_da_
Valued Contributor I
541 Views

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?

0 Kudos
3 Replies
Ad
New Contributor III
541 Views

If you work with AngularJS: angular-translate, works great!

https://angular-translate.github.io
 

0 Kudos
Chris_P_Intel
Employee
541 Views

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

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
541 Views

Thank you. I will search in Google for these solutions.

0 Kudos
Reply