...
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
- uitranslations
- InformationResourcesInformationMessages.resx
- InformationResourcesInformationMessages.sv.resx (Swedish)
- InformationResourcesInformationMessages.da.resx (Danish)
- .......
- ErrorMessages.resx
- ErrorMessages.sv.resx
- ErrorMessages.da.resx
- ........
- ......
- uitranslations
Some of the translation contains numeric placeholders for numbers or other values, these placeholders must be included in the translated value as well. An example of a numeric placeholder is {0} or {1}, these characters is replaced with a value at runtime and needs to should be present in the any new translations as well if the they exist in the base files value to get the correct behavior. Meridix has a custom built support for Custom placeholders as well, these placeholders has the syntax {=key:option} (See section below)
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.
...
Custom placeholders
Meridix has support for a placeholder syntax where commonly used words or sentences can be reused throughout the resource files. This makes is easy to replace the naming for specific actions/features in the system. The placeholder functionality is used by the default translations files to allow a easier editing of the translations since you only need to define a word or phrase once.
...
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 overriden 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.
Custom translation overrides
...
The file should be uploaded to the system as a package of the type package_translation_overrides
Placeholder values can be overridden by specifying the resourcepath as placeholders
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.