Localization

Colectica Portal can be translated to other languages. This functionality can also be used to change the text that is displayed for any reason. For example, your organization may wish to use different words to refer to metadata items (e.g., “Sweeps” instead of “Studies”).

To localize Colectica Portal, complete the following steps.

Localize the Content

Note

See https://github.com/Colectica/ColecticaPortal.LocalizationStarter for a project template that includes everything you need to translate Colectica Portal.

Note

The localization project can be edited and built with the free Visual Studio Community Edition.

To translate these resources to a new language:

  1. Rename the two resource files with the appropriate language. For example, if you are translating to Danish, you can rename the two files in the Resources folder to DdiItemStrings.da.resx and PortalStrings.da.resx.

  2. Edit the text in the resource files with your translations.

Build the Localization Assembly

  1. Build the project. This should create a file named bin\Debug\Colectica.Portal.resources.dll.

Deploy and Configure your Localization

To test your localized resources:

  1. Create a folder inside your Colectica Portal deployment directory. The folder should have the same name as your language (e.g., da\ for Danish).

  2. Copy the bin\Debug\Colectica.Portal.resources.dll file into this folder.

  3. Update the Language setting in appsettings.json with the code of the language you wish to use.

  4. Restart the Colectica Portal application in IIS.

Localize Email Notifications

Note

Default email message content are shipped in the Colectica Portal’s \Config-dist\EmailTemplates-dist folder.

To translate these resources to a new language:

  1. Move the email content JSON files from the distribution’s \Config-dist\EmailTemplates-dist folder to the Portal’s \Config\EmailTemplates folder in the install location.

  2. Edit the text in the JSON files with your translations.

Note

Be sure to properly escape the translated strings to conform to the JSON standard for string encoding. The following characters are reserved in JSON and must be properly escaped to be used in strings:

  • Backspace is replaced with \b

  • Form feed is replaced with f

  • Newline is replaced with \n

  • Carriage return is replaced with \r

  • Tab is replaced with \t

  • Double quote is replaced with "

  • Backslash is replaced with \