Localization¶
Colectica Repository 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”).
Colectica Repository determines the language of the user interface using these priorities:
If the user has selected an interface language from the top navigation bar, use that.
If the user’s browser sends an Accept-Language header supported by Repository, use that.
Use the default language specified in the server’s
appsettings.json
file.
To localize Colectica Repository web portal, complete the following steps.
Contents
Localize the Content¶
Note
See https://github.com/Colectica/ColecticaPortal.LocalizationStarter for a project template that includes everything you need to translate Colectica Portal.
Deploy and Configure your Localization¶
To test your localized resources:
Create a folder inside your Colectica Portal deployment directory. The folder should have the same name as your language (e.g.,
da\
for Danish).Copy the two
*.resources.dll
files into this folder.Update the
SupportedLanguages
andLanguage
settings inappsettings.json
with the code of the language you wish to use.Restart the Colectica Repository application.
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:
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.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 \