Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

FilenameDescription
NameOfResource.resxThe 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:

CodeDescription
enEnglish (no specific region)
en-GBEnglish (Great Britain)
en-USEnglish (United States of America)
svSwedish (no specific region)
sv-SESwedish (Sweden)
daDanish (no specific region)
da-DKDanish (Denmark)
noNorway
fiFinland

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 keyDescriptionExample of usage
:lowercaseConvert all characters to lowercase before being used{=Username:lowercase}
:uppercaseConvert all characters uppercase before being used{=Username:uppercase }
:capitalizefirstConvert 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.
Uses the .NET HttpUtility.HtmlEncode() method internally. (http://msdn.microsoft.com/en-us/library/system.web.httputility.htmlencode.aspx)

{=Username:htmlencode }
:urlencode

Encodes the values to a valid URL representation that can be used a in query strings etc.
Uses the .NET HttpUtility.UrlEncode() method internally. (http://msdn.microsoft.com/en-us/library/system.web.httputility.urlencode.aspx)

{=Username:urlencode }
:htmlnbspConverts 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

...

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.