Versions Compared

Key

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

...

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

...

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

...