Since version 2.3 it has been possible to enable multiple languages in the AppsAnywhere user interface. In this article we will look at how this managed.

In this article

Also in this section

There are no sub-sections to this page



Overview

AppsAnywhere is used every day, all over the world. To improve the user experience for those whose first language is not English (the only language which AppsAnywhere was originally shipped with), the system now supports the ability to translate the user interface into any language you wish, even one you just made up!

There are two things to configure when it comes to internationalization; your default language and whether or not you are going to provide your users with access to additional language options. In the case of AppsAnywhere, the "default" language refers to the fallback language that the system uses if no other languages are provided, or there are any problems encountered when attempting to provide an additional translation you have made available.

Once your default language is configured, you can choose whether or not to provide your users with additional language options. These additional language options are added to the system as you require and will be made available to the user as a selection in their preferences and at login.

Something To Note

For the purposes of the instructions in this article, consider AppRoot to be the base location of the deployed application (/var/www/appsanywhere/app/)

Configuring the default language

In AppsAnywhere, the default language is more than just a "preference", it is the core language that is used by the system, regardless of whether other languages are made available. It is also the language on which the system falls back in the case of any problems with other language options. 

  1. RDP to your AppsAnywhere server
  2. Navigate to the default language location at AppRoot/public/js/lang
  3. Here you will see the default language file; default.json

By default, AppsAnywhere comes with a default language of "English (United Kingdom)" meaning, for all standard installations, this is the only language available in the user interface.

As you will see in this folder, there are two other default files; default_uk.json and default_us.json. These language files are not used by the system but serve as a quick reference if you want to quickly change the default language file from UK to US English (and visa versa) as described below. 

Something To Note

Don't forget to make any changes to all of your AppsAnywhere servers to avoid any unexpected errors.

Changing the default language

You can easily change the "default" language used by AppsAnywhere by updating the contents of the default.json file, simply replace the contents with your chosen language (see below for more options) and this will act as default from then on. So if, for example, you would rather AppsAnywhere was presented in US English, either copy the contents of the default_us.json file into default.json or rename the files accordingly so that the default.json file contains the US translation. 

Adding additional languages

Above and beyond the default language, AppsAnywhere allows you to add any number of alternative languages that the user can choose from when using the system. These languages are loaded dynamically from a separate location on your AppsAnywhere servers. 

The location for all additional languages is AppRoot/public/lang.

Any language files added to this folder will be presented as options for the user at login and from within the user preferences section so that they can choose which language they want to use. 

Useful Information

By default, the language folder is empty, meaning that no language options will be available and only the language contained within the default.json file will be used. Language options only become activated when there is one or more additional language files in the ./public/lang/ folder.

You can either add additional language files by downloading one of those available below or creating your own. To add an additional language, follow the steps below:

  1. RDP to your AppsAnywhere server
  2. Navigate to the main language location at AppRoot/public/lang (note, this is not in the 'js' folder)
  3. Check that your language file is valid (as mentioned in the warning below)
  4. Copy the new language file into the language folder
  5. Copy the language image into the local image folder at AppRoot/public/lang
  6. Repeat 1-5 on all of your AppsAnywhere servers.
  7. To add the flag image file make sure you have the relevant flag in SVG format with the same name as your .json file
     e.g if language file is es_CA.json then the SVG needs to be named es_CA.svg
  8. Copy the .svg file to AppRoot/public/img/locale
  9. Repeat on all AppsAnywhere servers
  10. Login to AppsAnywhere with an account with admin privileges
  11. Click on Return to Admin to access the admin panel
  12. Go to Settings > Cache Settings
  13. Click Refresh next to the language cache

Warning

Make sure that you make any file changes to all of your AppsAnywhere servers before refreshing the language cache. Failure to make any added or modified files available on all servers hosting AppsAnywhere could result in system errors.

Available Languages

The following language files are provided by members of the Software2 Community. Software2 take no responsibility for the contents of the file or the quality of the translation. 

Software2 would like to pay special thanks to our customers that have provided these translations for the community. we also welcome any feedback on these translations or additions from community members. 

Writing your own language

If your preferred language isn't available to download above, then it's incredibly simple to create your own. 

To start, take a copy of the default.json file (we described where to find this above) and rename it with the ISO 639-1 code for the language being used, followed by an underscore and a two letter representation of the language subset or dialect; such as en_US (for English - United States) or es_CA (for Spanish - Catalan)

Open the file in a text editor that can offer at least basic syntax highlighting for javascript/json documents and update the _metadata section at the top of the file to describe your new language:

Example metadata

"_metadata":{
    "display_name":"My New Language",
    "locale_code":"en_NL",
    "locale_code_short":"en"
},
JS

Once you have done this, work your way through the file and translate the string values for each key to your chosen language. 

You will then need to choose an image to represent your language. Search online for an SVG version of the flag you wish to use to represent your language and save this with the same filename as the "locale_code" you defined in your language file. 

Once your translation is complete, follow the steps above for making the language available in AppsAnywhere. 

Warning

Language files must contain valid JSON. If there are any errors in the JSON file then there will be errors in the application of the language that may result in user functionality being unavailable. We strongly recommend that you run the contents of the language file through a JSON parser (such as http://jsonparseronline.com/) following any changes to ensure it is valid before copying it to your production servers.

Language files must be encoded in UTF-8 format without a BOM signature. Languages will not be recognized if the file is not encoded in plain UTF-8. 

Similarly, casing is important and files must be saved with the ISO 639-1 code for the language being used, followed by an underscore and a two letter representation of the language subset or dialect e.g. en_US (for English - United States) or es_CA (for Spanish - Catalan)

Useful Tip

There is a public repository of SVG flags at https://github.com/hjnilsson/country-flags

Setting a preferred language

If you are making additional languages available to your users, then you can select from within the admin interface of AppsAnywhere which one you wish to be used before the user selects their own preference. To do this follow the steps below:

  1. Login to AppsAnywhere with an account with admin privileges
  2. Click on Return to Admin to access the admin panel
  3. Go to Settings > General Settings
  4. Choose the language you wish to offer as default from the Default Language dropdown
  5. Click Save

Something To Note

The language preference of the user (either made at login, or from the user preferences page) will always take priority over that set by the administrator.

Default Language Files

For reference, the default language files for version 2.10 can be found below:




Some other articles you might find useful:


Written By: