Localisation using GNU gettext
Parley supports localisation using GNU gettext (PO) files and aims to follow the Godot guidance and info described here. This is especially useful if you want to support plurals and context in your translations. However, it is a more complex format than CSV files.
With Parley, users use PO files to manage internationalisation. Information on how to create PO files can be found here.
This approach in Parley can be broken down into two key components:
msgid- this corresponds to thetextvalue that is used to identify the translation. E.g. thetextfield on the Dialogue or Dialogue Option Node.msgctxt- this corresponds to the Translation Key on the node. For example, thetext_translation_keyon a Dialogue Node.
InfoPlease note, at the moment, Parley does not currently support adding notes for translators. However, this will be implemented in a future release.
As an example, let’s say we have the following nodes:
{
"nodes": [
{
"id": "node:1",
"text": "I have a coffee.",
"text_translation_key": ""
// ...
},
{
"id": "node:2",
"text": "Give to Alice.",
"text_translation_key": "GIVE_TO_ALICE"
}
// ...
]
// ...
}This would be equivalent to the following POT file:
# node:1
msgid "I have a coffee."
# node:2
msgctxt "GIVE_TO_ALICE"
msgid "Give to Alice."TipBy default, translation keys for Nodes will not be set and creating them for every Node in a Dialogue Sequence can be a pain. However, this is easily rectified by clicking the
Translations->Generate Text Translation Keys...button in the Parley plugin view. This will generate a text Translation Key for every Dialogue or Dialogue Option Node that doesn’t have a populated Text Translation Key in the Dialogue Sequence.