2015-05-14, 01:31
I haven't asked anyone on Team Kodi about this yet, so it's possible someone there can already hook me up with a solution, but I still wanted to post this where non-team members can also offer to help.
What is this?
Kodi contains "strings" where all the message text is stored. This includes warnings, settings descriptions, button labels, and more. What I would like to do is use some kind of automated/semiautomated script to pull the strings from github ( https://github.com/xbmc/xbmc/blob/master...strings.po ) and place them on a wiki page that would allow them to be usable in the same way we use them in Kodi.
This would allow for a few things, such as consistency for settings descriptions, more automated updates to the wiki making things easier to maintain, and would also help us in the future for a multi-lingual wiki. Some might know that we also use an automated python script to generate add-on pages, so that add-on authors and users can add documentation and notes about their add-ons. In fact, a great deal more can be automated, like a new setting being added to Settings/Appearances (wiki), by reading the settings.xml file. For now we'll just start out with the strings and see where that takes us.
How?
There's probably a bunch of ways to do this, but the two that stand out in my mind are either one single wiki document that is formatted in sections like this:
or as seperate wiki template pages that are named after the string ID and only contain the string itself. Even if there are thousands of thousands of them, that shouldn't matter as only the required templates get loaded for a given wiki page, and even those get cached on the web server.
Both would need to stip/convert any formatting, such as escaping quotes like
converted to just
Either method (single wiki page or multiple wiki pages) would result in something that I could put to use, but my skills in creating a script to easily format them are limited. If anyone is interested in helping with this, such as any python experts, I would be in your debt.
What is this?
Kodi contains "strings" where all the message text is stored. This includes warnings, settings descriptions, button labels, and more. What I would like to do is use some kind of automated/semiautomated script to pull the strings from github ( https://github.com/xbmc/xbmc/blob/master...strings.po ) and place them on a wiki page that would allow them to be usable in the same way we use them in Kodi.
This would allow for a few things, such as consistency for settings descriptions, more automated updates to the wiki making things easier to maintain, and would also help us in the future for a multi-lingual wiki. Some might know that we also use an automated python script to generate add-on pages, so that add-on authors and users can add documentation and notes about their add-ons. In fact, a great deal more can be automated, like a new setting being added to Settings/Appearances (wiki), by reading the settings.xml file. For now we'll just start out with the strings and see where that takes us.
How?
There's probably a bunch of ways to do this, but the two that stand out in my mind are either one single wiki document that is formatted in sections like this:
Code:
<section begin="string-286" />Preferred subtitle language<section end="string-286" />
or as seperate wiki template pages that are named after the string ID and only contain the string itself. Even if there are thousands of thousands of them, that shouldn't matter as only the required templates get loaded for a given wiki page, and even those get cached on the web server.
Both would need to stip/convert any formatting, such as escaping quotes like
Code:
"Press \"user\" button command"
converted to just
Code:
"Press "user" button command"
Either method (single wiki page or multiple wiki pages) would result in something that I could put to use, but my skills in creating a script to easily format them are limited. If anyone is interested in helping with this, such as any python experts, I would be in your debt.