Configure a custom language display


Overview

Out of the box, CAST Imaging offers two languages for the display of labels and other UI items via the Preferred Language option in the Preferences panel:

  • English (en_US) - default
  • Chinese (zh_CN)

Instructions below explain how to add your own custom language.

Step 1 - Translate and rename default file

Locate the en.json file on the machine running the imaging-viewer component in your CAST Imaging installation (this file contains all the UI label text in English):

%PROGRAMFILES%\CAST\Imaging\CAST-Imaging-Viewer\nginx\html\locales

Copy this file somewhere else on your local machine so that you can modify it for your own custom language. Use an auto translate service such as https://translate.i18next.com/external link which is designed to accept .json files as input.

Now rename the file to match your custom language, for example fr.json for French.

Step 2 - Add your custom language to your install

Locate the app-config.js file in your CAST Imaging installation:

%PROGRAMFILES%\CAST\Imaging\CAST-Imaging-Viewer\nginx\html\app-config.js

Find the following line and add in your custom language (French in this example):

languages: [{ 'Chinese': 'ch' },{ 'French': 'fr' }], // Add new languages e.g., [{LanguageName: languageCode}, {'': '' }]

Where:

  • LanguageName (e.g., ‘French’) is the name of the language as it will appear in the UI - this must match the locale used in the languageCode entry below.
  • languageCode (e.g., ‘fr’) represents the language. This must match the name of the corresponding .js file in the locales directory.

Step 3 - Enable the custom language in the UI

There is no need to restart any CAST Imaging services in order to see the new custom language in the Preferences panel, however, you may need to empty your browser cache before it appears: