Open main menu

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

Update description for version 4
(Update description to cover version 3)
(Update description for version 4)
 
Line 17: Line 17:
# a block with the mapping for codepage m
# a block with the mapping for codepage m


The latest file format version is 3. The description below is for version 3 but indicate blocks added from version 1 and 2.
The latest file format version is 4. The description below is for version 4 but indicate blocks added, removed, or changed from version 1, 2 and 3.
* Version 2 adds context information in the  [[#Translated messages|translated messages]].
* 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).
* Version 3 adds code page descriptions (for translations not using ASCII or ISO-8859-1).
* Version 4 uses UTF-8 for translations and drops the code page descriptions.


== The header ==
== The header ==
Line 25: Line 26:
!Type    !! Size  !! Order  !! Description
!Type    !! Size  !! Order  !! Description
|-
|-
|String  || 12   ||             || 'TRANSLATIONS'
|String  || 12   ||           || 'TRANSLATIONS'
|-
|-
|Byte     || 1    ||             || Version (of the file format)
|Byte   || 1    ||           || Version (of the file format)
|-
|-
|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)      || Only in version 3: Number of code pages
|-
|-
|uint16 || 2     || BE        || Size in bytes of block 1 (list of languages)
|uint32  || 4     || BE        || Size in bytes of block 1 (list of languages)<br>In version 3 and below the type is uint16
|-
|-
|uint16 || 2     || BE       || Size in bytes of block 2 (list of codepages - in version 3 and above)
|(uint16)|| (2|| (BE)      || Only in version 3: Size in bytes of block 2 (list of codepages)
|-
|-
|uint16 || 2     || BE        || Size in bytes of block 3 (english messages)
|uint32  || 4     || BE        || Size in bytes of block 3 (english messages)<br>In version 3 and below the type is uint16
|-
|-
|uint16 || 2     || BE        || Size in bytes of block 4 (first translation)
|uint32  || 4     || BE        || Size in bytes of block 4 (first translation)<br>In version 3 and below the type is uint16
|-
|-
|uint16 || 2     || BE        || Size in bytes of block 5 (second translation)
|uint32  || 4     || BE        || Size in bytes of block 5 (second translation)<br>In version 3 and below the type is uint16
|-
|-
|...         || ...   || ...       || ...
|...     || ...   || ...       || ...
|-
|-
|uint16 || 2     || BE        || Size in bytes of block n+2 (n<sup>th</sup> translation)
|uint32  || 4     || BE        || Size in bytes of block n+2 (n<sup>th</sup> translation)<br>In version 3 and below the type is uint16
|}
|}


Size for the codepage mapping blocks is not written since they all are 256 * 4 bytes long.
In version 3 with code page mapping information, the size for the codepage mapping blocks is not written since they all are 256 * 4 bytes long.


== List of Languages ==
== List of Languages ==
Line 67: Line 68:


== List of Codepages ==
== List of Codepages ==
'''This block is only present in version 3 and was removed in version 4.'''
For each codepage there is the following entry:
For each codepage there is the following entry:


Line 108: Line 111:
!Type    !! Size  !! Order  !! Description
!Type    !! Size  !! Order  !! Description
|-
|-
|uint16 || 2    || BE        || Number of translated messages
|uint16 || 2    || BE        || Number of translated messages
|-
|-
|uint16 || 2     || BE        || Size (in bytes) of the charset string (including the terminating '\0')
|(uint16)||(2)    || (BE)       || Only in version 3 and below: Size (in bytes) of the charset string (including the terminating '\0')
|-
|-
|String || ??   ||            || Charset (e.g. 'iso-8859-1')
|(String)|| (??||            || Only in version 3 and below: Charset (e.g. 'iso-8859-1')<br>In version 4 and above the charset is always UTF-8
|-
|-
|             ||      ||            || First translation entry (see below)
|       ||      ||            || First translation entry (see below)
|-
|-
|...         || ...    || ...        || ...
|...     || ...    || ...        || ...
|-
|-
|             ||      ||            || Last translation entry
|       ||      ||            || Last translation entry
|}
|}


Line 137: Line 140:


== Codepage mapping ==
== Codepage mapping ==
'''This block is only present in version 3 and was removed in version 4.'''
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.
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"
{| border="1" cellpadding="2" cellspacing="0"
TrustedUser
2,147

edits