2020-07-01, 12:43
Just upgrading an addon I have for Kodi 19. The old strings.xml file is no longer supported and a strings.po is. The documentation is incomplete however:
https://kodi.wiki/view/Language_support
And I see a possible opportunity to improve readability of settings.xml.
Traditionally settings.xml references labels with an id. a number from 32001 up. Really poor readability in the definition files alas.
The .po format defines a label with three properties like:
msgctxt "#32001"
msgid "Recommended"
msgstr ""
Some clear confusion here. For starters the old id seems encoded in ctxt not in id and the id is now a string.
Does this mean we can improve horrid settings like:
<string id="32001">Recommended</string>
to read:
<string id="Recommended">Recommended</string>
Now that would rock!
It also fails to document what msgstr is. There's a sample on that page above:
msgid ""
msgstr ""
"Project-Id-Version: Kodi Addons\n"
"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Kodi Translation Team\n"
"Language-Team: English (http://www.transifex.com/projects/p/xbmc...age/en/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Wholly unexplained but seems to suggest that:
https://kodi.wiki/view/Language_support
And I see a possible opportunity to improve readability of settings.xml.
Traditionally settings.xml references labels with an id. a number from 32001 up. Really poor readability in the definition files alas.
The .po format defines a label with three properties like:
msgctxt "#32001"
msgid "Recommended"
msgstr ""
Some clear confusion here. For starters the old id seems encoded in ctxt not in id and the id is now a string.
Does this mean we can improve horrid settings like:
<string id="32001">Recommended</string>
to read:
<string id="Recommended">Recommended</string>
Now that would rock!
It also fails to document what msgstr is. There's a sample on that page above:
msgid ""
msgstr ""
"Project-Id-Version: Kodi Addons\n"
"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Kodi Translation Team\n"
"Language-Team: English (http://www.transifex.com/projects/p/xbmc...age/en/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Wholly unexplained but seems to suggest that:
- msgstr can be multline with a string per line?
- A blank id is used to define the properties of the addon?