Open main menu

Difference between revisions of "Supporting GUI Translation/Translations DAT Format"

Update description to cover version 3
(Update description for new format.)
(Update description to cover version 3)
Line 6: Line 6:
# [[#The header|a header]]
# [[#The header|a header]]
# [[#List of Languages|a block with the list of languages]]
# [[#List of Languages|a block with the list of languages]]
# [[#List of Codepages|a block with the list of codepages]]
# [[#English messages|a block with the the english messages]]
# [[#English messages|a block with the the english messages]]
# [[#Translated messages|a block with the translated messages for language 1]]
# [[#Translated messages|a block with the translated messages for language 1]]
Line 11: Line 12:
# ...
# ...
# a block with the translated messages for language n
# a block with the translated messages for language n
#  [[#Codepage mapping|a block with the mapping for codepage 1]]
# a block with the mapping for codepage 2
# ...
# a block with the mapping for codepage m


The following description is valid for version 2 of the file format. Version 1 is very similar but does not contain the context strings in the [[#Translated messages|translated messages]].
The latest file format version is 3. The description below is for version 3 but indicate blocks added from version 1 and 2.
* Version 2 adds context information in the [[#Translated messages|translated messages]].
* Version 3 adds code page descriptions (for translations not using ASCII or ISO-8859-1).


== The header ==
== The header ==
Line 23: Line 30:
|-
|-
|uint16 || 2    || BE        || Number of translations
|uint16 || 2    || BE        || Number of translations
|-
|uint16 || 2    || BE        || Number of code pages (version 3 and above)
|-
|-
|uint16 || 2    || BE        || Size in bytes of block 1 (list of languages)
|uint16 || 2    || BE        || Size in bytes of block 1 (list of languages)
|-
|-
|uint16 || 2    || BE        || Size in bytes of block 2 (english messages)
|uint16 || 2    || BE        || Size in bytes of block 2 (list of codepages - in version 3 and above)
|-
|-
|uint16 || 2    || BE        || Size in bytes of block 3 (first translation)
|uint16 || 2    || BE        || Size in bytes of block 3 (english messages)
|-
|-
|uint16 || 2    || BE        || Size in bytes of block 4 (second translation)
|uint16 || 2    || BE        || Size in bytes of block 4 (first translation)
|-
|uint16 || 2    || BE        || Size in bytes of block 5 (second translation)
|-
|-
|...        || ...    || ...        || ...
|...        || ...    || ...        || ...
Line 36: Line 47:
|uint16 || 2    || BE        || Size in bytes of block n+2 (n<sup>th</sup> translation)
|uint16 || 2    || BE        || Size in bytes of block n+2 (n<sup>th</sup> translation)
|}
|}
Size for the codepage mapping blocks is not written since they all are 256 * 4 bytes long.


== List of Languages ==
== List of Languages ==
Line 46: Line 59:
|uint16 || 2    || BE        || Size (in bytes) of the following string (including the terminating '\0')
|uint16 || 2    || BE        || Size (in bytes) of the following string (including the terminating '\0')
|-
|-
|String  || ??    ||            || Language and country code (e.g. 'de_DE')
|String  || ??    ||            || Language and country code (e.g. 'de_DE'). The country code is optional (e.g. 'eu').
|-
|-
|uint16 || 2    || BE        || Size (in bytes) of the language name string (including the terminating '\0')
|uint16 || 2    || BE        || Size (in bytes) of the language name string (including the terminating '\0')
|-
|-
|String  || ??    ||            || Language name (e.g. 'Deutsch')
|String  || ??    ||            || Language name (e.g. 'Deutsch'). This is the name that appears in the GUI.
|}
 
== List of Codepages ==
For each codepage there is the following entry:
 
{| border="1" cellpadding="2" cellspacing="0"
!Type    !! Size  !! Order  !! Description
|-
|uint16 || 2    || BE        || Size (in bytes) of the following string (including the terminating '\0')
|-
|String  || ??    ||            || Codepage name (e.g. 'iso-8859-5')
|}
|}


Line 110: Line 134:
|-
|-
|String  || ??    ||            || Context string (if a context is defined).
|String  || ??    ||            || Context string (if a context is defined).
|}
== Codepage mapping ==
For each codepage there is a block giving the mapping from each character of the 8 bits codepage (e.g. iso-8859-5) to the equivalent unicode glyph.
{| border="1" cellpadding="2" cellspacing="0"
!Type    !! Size  !! Order  !! Description
|-
|uint32 || 4    || BE        || Mapping for a char value of 0
|-
|uint32 || 4    || BE        || Mapping for a char value of 1
|-
|...        || ...    || ...        || ...
|-
|uint32 || 4    || BE        || Mapping for a char value of 255
|}
|}
TrustedUser
2,147

edits