...
Introduction to Meridix resource/translation files
Meridix Studio Platform has support for multiple languages both for the user interface and for the report content (columns and descriptions). This article is meant to describe how the translation process for new languages can be handled for external translators.
...
Name{.culture-code}.resx
Examples:
Filename | Description |
---|---|
NameOfResource.resx | The default/fallback resource file. (English in Meridix) |
NameOfResource.sv.resx or NameOrResource.da.resx | A resource file with Swedish (sv) translations and a file with Danish translations. |
NameOfResource.sv-SE.resx or NameOfResource.sv-FI.resx | A resource file with Swedish (sv) translations but with support for a region as well. For example sv-SE means Swedish (Sweden) while sv-FI means Swedish (Finland). So it is possible to have different translations depending on the region of the users as well. |
Example of culture codes are:
Code | Description |
---|---|
en | English (no specific region) |
en-GB | English (Great Britain) |
en-US | English (United States of America) |
sv | Swedish (no specific region) |
sv-SE | Swedish (Sweden) |
da | Danish (no specific region) |
da-DK | Danish (Denmark) |
no | Norway |
fi | Finland |
A full list of valid region codes can be found at http://azuliadesigns.com/culture-codes/
...
Multiple option suffixes can be combined and the will be evaluated in the order they appear. E.g. key:lowercase:capitalizefirst:uppercase will make all characters in upper case since the last option (uppercase) will change the previous option results.
Option key | Description | Example of usage |
---|---|---|
:lowercase | Convert all characters to lowercase before being used | {=Username:lowercase} |
:uppercase | Convert all characters uppercase before being used | {=Username:uppercase } |
:capitalizefirst | Convert the first character uppercase before being used. This does not convert the other characters lowercase. Combine with :lowercase to make only the first character in uppercase. | {=Username:capitalizefirst} {=Username:lowercase:capitalizefirst} |
:htmlencode | Encodes the values to a valid HTML representation, replacing any characters that would otherwise be interpreted as HTML tags. | {=Username:htmlencode } |
:urlencode | Encodes the values to a valid URL representation that can be used a in query strings etc. | {=Username:urlencode } |
:htmlnbsp | Converts all spaces to to prevent unwanted line breaks in HTML based user interfaces. Is only used when a web based UI is calling the placeholder feature. | {=Username:htmlnbsp } |
Placeholders can also be overridden just as any other resource. To override a resource define a package of the type package_translation_overrides (see next section) and the resource path should be defined as placeholders
Additional placeholder values can be added to the placeholder file and can then be used from any other resource file.
Info |
---|
If a value from another resource file than the default placeholders file is needed a source prefix can be used {=source_resource_name@key:options} can be used where source_resource_name is the name of the resource file where the key can be found. |
Custom translation overrides
There are a hook that allows a customer to override translations for a specific languages without altering the binary build. This feature is meant to allow a customer to enable a specific terminology to increase the user terminology recognition from other systems.
Custom text files can be created and uploaded as packages in Meridix containing lines in the format defined below, each of these files (packages) is then loaded and used as overrides to the build built in (compiled) translations.
...
Format:
"{langauge-code}";"{resourcepath}";"{key}";"{value}"
Info |
---|
Note that the delimiter needs to be semicolons ; |
Example of file content:
"sv";"Login.aspx";"lbnLoginResource1.Text";"I want to log in"
"sv";"Login.aspx";"lbnLoginResource1.ToolTip";"I want to log in right now"
This would override the values for the Swedish translation for the login button on the login page.
Naming:
The packages of the type package_translation_overrides_text can be named to anything you prefer to keep the files structured. The package names is not used by the system.
...
Naming:
The naming of the package should be in the following format {resource_set_base_name}.{culture}.resx where the package name is used to identify the values and type of culture that the file contains translations for. To add a base/fallback resource set this way the "en" culture name should be used in the filename.
The file should be uploaded to the system as a package of the type package_translation_overrides_text or package_translation_overrides_resx depending on the package format.
...
Another open source (free) tool is SimpleResxEditor found at http://code.google.com/p/simpleresxeditor/ which also works with the RESX files directly. But this tool only allows the translator to work with only one resource set at a time.