Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 13 Next »

Introduction to Meridix resource/translation files

Meridix Studio 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.

Meridix uses a modified approach based on the default localization support in Microsoft.NET using RESX resource files. The RESX files are XML files with a specific scheme and each group of resources (translations) consists of a base file with the default and fallback language which in Meridix is English and additional translated files for different languages.
This means that if a localizable string can not be found in the currently selected language pack (ex: Swedish or Danish) the default English resource is used instead as a fallback value.
A resource files contains a key and a value and an optional comment that is only used during the translation to help the translator and is not used by the application.

Read more about the RESX file format here: http://msdn.microsoft.com/en-us/library/ekyft91f%28v=vs.80%29.aspx

The combination of the Resource file path with the key makes up a resource value. Ex: ResourceSets/ui/pages/Login.aspx.resx contains a key named lbnLoginResource1.Text which is used for the text on the login button on the login page.

The following naming scheme for the RESX files are used:

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/

When creating the files its important that the specific languages resource files is located in the same folder as the base resource file, the structure of the files can not be changes since the system is dependent on the file paths to the base file.
Example of the folder structure in Meridix:

  • ResourceSets
    • ui
      • InformationResources.resx
      • InformationResources.sv.resx (Swedish)
      • InformationResources.da.resx (Danish)
      • .......
    • system
      • ErrorMessages.resx
      • ErrorMessages.sv.resx
      • ErrorMessages.da.resx
      • ........
    • ......

Some of the translation contains placeholders for numbers or other values, these placeholders must be included in the translated value as well. An example of a placeholder is {0}   or {1}, these characters is replaced with a value at runtime and needs to be present in the new translations if the exist in the base files value.

An example is:
Report has been running for {0} seconds

This text can now be displayed at runtime as:
Report has been running for 10 seconds
or
Rapporten har körts i 10 sekunder
(Swedish)

Working with the resource files

Since the translations are stored in a known standardized format there are several ways how they can be translated. The simplest but maybe not the most efficient solution is to export all the values to a Excel file and work with the keys and translations there. But there are several other open source tools that can assist the translator while translating the information as well as helping with the creation of files for new languages.

Tool: Excel

The simplest way to working with the resources is to get the list and work with the values there. When the translation process is complete the Excel file is sent back to Meridix that reintegrates the translated values to the RESX files.

Tool: Zeta resource editor

An open source (free) tool that Meridix uses internally is the Zeta resource editor found at http://www.zeta-resource-editor.com. This tool provides great assistance when working with the RESX files, Meridix also has specific solution files defined for the tool that groups the resources so that information that is visible to end users (non admin) are grouped in a way that lets a translator work with a specific part of the system in isolation in cases where the complete UI should not be translated.

When using Zeta resource editor the translator are working directly with the resource files and when the translation process is complete the resource files are sent back to Meridix to integrate back into the system.

The user interface lets you see all the available translations side by side as well as the comment for the value if its exist any.

The tool also has a project structure where Meridix has divided the resources by whether the content is visible to End user or only for administrators.

And if you expand the End user section the resources is displayed per RESX file sets (base + ex: sv and dk files)

Tool: SimpleResxEditor

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.

Integrating translations into Meridix

By default Meridix translations are built into the system at build time and can not be altered at runtime. So when a translator is done with the translation for a language the files (resx or excel depending on the approach) needs to be sent back to Meridix which will integrate the translation into the build process.

Placeholders

Meridix has support for a placeholder syntax

Custom translations

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 in (compiled) translations.

Format:
"{langauge-code}";"{resourcepath}";"{key}";"{value}"

Example of file content:
"sv";"/Default.aspx";"lbnLoginResource1.Text";"I want to log in"
"sv";"/Default.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.

The file should be uploaded to the system as a package of the type package_translation_overrides

This feature is only used when customers have specific requirements and are not a recommended solution for translation of resources if not necessary.

Report content (ex: column headers) are currently not overridable. This may change in upcoming releases.

  • No labels