AnyLogic
Expand
Font size

Private Cloud: Custom Localization

Applies to AnyLogic Cloud 2.5.0. Last modified on November 20, 2024.

You can configure your Private Cloud instance to use a custom localization package. You can localize most of the Private Cloud UI, including common interface elements, configuration screens, administrator panel, and so on.

Localization is supported using Transloco, an Angular internationalization library.

Prerequisites

To get started, you need a package containing JSON files that will be used by the instance to replace the strings in the UI. To obtain the package, request it from our support team at support@anylogic.com.

The package includes the following files:

  • xx.json — Contains most of the strings visible by guests and regular users, including dashboard and user profile settings.
  • admin/xx.json — Contains strings displayed in the administrator panel.
  • model/xx.json — Contains strings displayed on the model screen and its tabs.

Edit these files to build your localization package.

Configuring the instance

  1. Start by selecting a valid language code from the Unicode Languages and Scripts list.
    • Do not use codes of languages included in your Private Cloud shipment.
    • Using a code from this list is the hard requirement for the Transloco library, but you don’t have to follow its conditions and just choose any free code for your needs.
  2. Rename the files in the localization package with the chosen language code. For example, for a French localization package, the file names should look like this:
    fr.json
    admin/fr.json
    model/fr.json
  3. To configure the controller component and make it aware of the new localization, edit the frontend.json file, located in the /alc/controller/conf directory in your Private Cloud installation.
    Add a code for your language (for example, "fr") to the list of languages. Make sure that the resulting file is a valid JSON file.
    Optionally, you can set the instance to use your new localization by default. To do this, set a new value for the "defaultValue" JSON field.
  4. Navigate to the /alc/controller/preload/frontend/assets/i18n/ directory in your Private Cloud installation.
  5. Place your localization package into the directory, preserving its structure. The primary file (in our example, fr.json) should end up in the i18n directory, and the auxiliary files will be located in i18n/admin/fr.json and i18n/model/fr.json respectively.
  6. In all the primary localization files in the i18n folder, specify the name for your new language. To do this, locate the languages JSON array and add an element for your new language, such as:
    "languages": {
      "en": "English",
      "zh": "中文",
      "fr": "Français"
    }
  7. In a Linux terminal on the machine running the controller and frontend components, execute the following command:
    sudo docker restart controller && sudo docker stop frontend

After a little while, the required components will restart and the localization package will be applied. You will then be able to use Private Cloud translated into your preferred language.

To switch between the available languages, use the drop-down picker on the main toolbar.

How can we improve this article?