Fix nested definition lists in QM docs
continuous-integration/drone/push Build is failing Details

This commit is contained in:
~lucidiot 2022-09-25 23:04:37 +02:00
parent 7661ff3d57
commit 26f3e071cd
1 changed files with 96 additions and 96 deletions

View File

@ -36,31 +36,31 @@ Block:
```
Tag (unsigned byte)
: One of the following:
: One of the following:
0x2F
: Contexts block
0x42
: Hashes block
0x69
: Messages block
0x88
: Numerus Rules block
0x96
: Dependencies block
0xA7
: Language block
0x2F
: Contexts block
0x42
: Hashes block
0x69
: Messages block
0x88
: Numerus Rules block
0x96
: Dependencies block
0xA7
: Language block
Block length (unsigned int32)
: The size of the block's contents, measured in bytes.
: The size of the block's contents, measured in bytes.
Block contents
: The contents of each block depend on the tag.
: The contents of each block depend on the tag.
There should only be one of each block tag in a single file. There should always be a Hashes block.
@ -89,10 +89,10 @@ Hash table:
```
Length (unsigned int16)
: Length of the hash table.
: Length of the hash table.
Offset (unsigned int16)
: Offset, in bytes, within the context pool, where the context's string should be seeked. Note that the context string probably will not be found at this offset; it will be found further away. All offsets should be multiples of 2. An offset of 0 means this hash does not exist in this file.
: Offset, in bytes, within the context pool, where the context's string should be seeked. Note that the context string probably will not be found at this offset; it will be found further away. All offsets should be multiples of 2. An offset of 0 means this hash does not exist in this file.
Note that the hash table's size may exceed the actual amount of contexts, resulting in many offsets being set to zero.
@ -117,13 +117,13 @@ Context:
```
Length (unsigned byte)
: The length of the context string in bytes.
: The length of the context string in bytes.
Context (string)
: The context name, truncated to up to 255 characters.
: The context name, truncated to up to 255 characters.
Padding (optional unsigned byte)
: An extra null byte (`0x00`) may be added to ensure the size of this whole block is a multiple of 2.
: An extra null byte (`0x00`) may be added to ensure the size of this whole block is a multiple of 2.
### Hashes block
@ -146,10 +146,10 @@ Hash:
```
Hash (unsigned int32)
: A hash of the bytes represented by the concatenation of the source text and of the comment strings of a single message. This can be used for faster lookup of translations, since the source text and comment are defined in the source code.
: A hash of the bytes represented by the concatenation of the source text and of the comment strings of a single message. This can be used for faster lookup of translations, since the source text and comment are defined in the source code.
Offset (unsigned int32)
: Offset, in bytes, of the start of the message designated by this hash, starting from the beginning of the contents of the Messages block.
: Offset, in bytes, of the start of the message designated by this hash, starting from the beginning of the contents of the Messages block.
### Messages block
@ -176,20 +176,20 @@ Attribute:
```
Tag (unsigned byte)
: One of the following:
: One of the following:
1. End
2. Source text (UTF-16)
3. Translation
4. Context (UTF-16)
5. Hash (obsolete)
6. Source text
7. Context
8. Comment
9. Unknown (obsolete)
1. End
2. Source text (UTF-16)
3. Translation
4. Context (UTF-16)
5. Hash (obsolete)
6. Source text
7. Context
8. Comment
9. Unknown (obsolete)
Attribute contents
: The contents of each attribute depend on the tag.
: The contents of each attribute depend on the tag.
* There should only be one Comment attribute.
* There should only be one of either a Context or a Context (UTF-16) attribute.
@ -211,10 +211,10 @@ Attribute contents (Source text (UTF-16) attribute):
```
Length (int32)
: Length of the string, in bytes. Should always be a multiple of 2, unless it is negative, which indicates an empty string.
: Length of the string, in bytes. Should always be a multiple of 2, unless it is negative, which indicates an empty string.
Source text (UTF-16 string)
: The source text for this message. If the translations are ID-based, this will be the ID of this translation, and the context and comment will always be empty.
: The source text for this message. If the translations are ID-based, this will be the ID of this translation, and the context and comment will always be empty.
#### Translation attribute
@ -226,10 +226,10 @@ Attribute contents (Translation attribute):
```
Length (int32)
: Length of the string, in bytes. Should always be a multiple of 2, unless it is negative, which indicates an empty string.
: Length of the string, in bytes. Should always be a multiple of 2, unless it is negative, which indicates an empty string.
Translation (UTF-16 string)
: The translated text for this message.
: The translated text for this message.
#### Context (UTF-16) attribute
@ -241,10 +241,10 @@ Attribute contents (Context (UTF-16) attribute):
```
Length (int32)
: Length of the string, in bytes. Should always be a multiple of 2, unless it is negative, which indicates an empty string.
: Length of the string, in bytes. Should always be a multiple of 2, unless it is negative, which indicates an empty string.
Context (UTF-16 string)
: Name of the context in which this message appears. This is usually a Qt class name.
: Name of the context in which this message appears. This is usually a Qt class name.
#### Hash attribute
@ -256,7 +256,7 @@ Attribute contents (Hash attribute):
```
Hash (uint32)
: Hash of the message. This is now only stored in the separate Hashes block.
: Hash of the message. This is now only stored in the separate Hashes block.
#### Source text attribute
@ -268,10 +268,10 @@ Attribute contents (Source text attribute):
```
Length (unsigned int32)
: Length, in bytes, of the source text.
: Length, in bytes, of the source text.
Source text (string)
: The source text for this message. If the translations are ID-based, this will be the ID of this translation, and the context and comment will always be empty.
: The source text for this message. If the translations are ID-based, this will be the ID of this translation, and the context and comment will always be empty.
#### Context attribute
@ -283,10 +283,10 @@ Attribute contents (Context attribute):
```
Length (unsigned int32)
: Length, in bytes, of the context.
: Length, in bytes, of the context.
Context (string)
: Name of the context in which this message appears. This is usually a Qt class name.
: Name of the context in which this message appears. This is usually a Qt class name.
#### Comment attribute
@ -298,10 +298,10 @@ Attribute contents (Comment attribute):
```
Length (unsigned int32)
: Length, in bytes, of the comment.
: Length, in bytes, of the comment.
Comment (string)
: A comment left by the developer on this message, meant for disambiguation.
: A comment left by the developer on this message, meant for disambiguation.
https://doc.qt.io/qt-6/i18n-source-translation.html#disambiguation
@ -315,7 +315,7 @@ Attribute contents (Unknown obsolete attribute):
```
Byte (unknown, 1 byte)
: No definition known.
: No definition known.
This attribute is not found in Qt 2.1.1, and can be found in Qt 2.2.0 as "Obsolete 1". It is now known as "Obsolete 2", because the Hash attribute because "Obsolete 1". I cannot find any other versions between those two version nombers those could tell what this attribute was for.
@ -331,50 +331,50 @@ Block contents (Numerus Rules block):
```
Rule component (unsigned byte)
: Either an integer, an arithmetic operator with optional flags, a logical operator or a rule separator.
: Either an integer, an arithmetic operator with optional flags, a logical operator or a rule separator.
The following arithmetic operators are defined:
The following arithmetic operators are defined:
0x01
: Equality operator. Followed by one integer X, means "the value is equal to X".
0x02
: Less than operator. Followed by one integer X, means "the value is less than to X".
0x03
: Less than or equal operator. Followed by one integer X, means "the value is less than or equal to X".
0x04
: Between operator. Followed by two integers X and Y, means "the value is between X and Y".
The following flags can be applied to the arithmetic operators:
0x08
: Not.
0x10
: Modulo 10. Get the remainder of the division of the value by 10 before applying the operator.
0x20
: Modulo 100. Get the remainder of the division of the value by 100 before applying the operator.
0x40
: Leading 1000. Meaning is unclear.
The following logical operators are defined:
0xFD
: And.
0xFE
: Or.
The logical operators apply in their order of definition; "A and B or C and D" means "((A and B) or C) and D".
Finally, the rule separator is defined:
0xFF
: New rule.
0x01
: Equality operator. Followed by one integer X, means "the value is equal to X".
0x02
: Less than operator. Followed by one integer X, means "the value is less than to X".
0x03
: Less than or equal operator. Followed by one integer X, means "the value is less than or equal to X".
0x04
: Between operator. Followed by two integers X and Y, means "the value is between X and Y".
The following flags can be applied to the arithmetic operators:
0x08
: Not.
0x10
: Modulo 10. Get the remainder of the division of the value by 10 before applying the operator.
0x20
: Modulo 100. Get the remainder of the division of the value by 100 before applying the operator.
0x40
: Leading 1000. Meaning is unclear.
The following logical operators are defined:
0xFD
: And.
0xFE
: Or.
The logical operators apply in their order of definition; "A and B or C and D" means "((A and B) or C) and D".
Finally, the rule separator is defined:
0xFF
: New rule.
The numerus rules are applied to a numeric value to determine whether the name associated with this value should be pluralized. Each rule is applied one after the other, and maps to a different pluralization form. The amount of pluralization forms depends on the language.
@ -390,7 +390,7 @@ Block contents (Dependencies block):
```
Dependency (string)
: The name of a file in the same directory as this one that this file depends on.
: The name of a file in the same directory as this one that this file depends on.
### Language block
@ -402,7 +402,7 @@ Block contents (Language block):
```
Language code (string)
: Holds the language code of the translation file.
: Holds the language code of the translation file.
## References