...
The following naming scheme for the RESX files are used:
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 |
...
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
- ........
- ......
- ui
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
...