WIP Po file utility for Python Addons: poxbmc.py
#1
Image

POXBMC
The main purpose of this python script is to make working with localized strings and your main strings.po file easier when creating addons for XBMC. The user can mark lines with hard coded strings that need to be localized by ending with a comment (# @@). The script will scan through the working directory of the script and locate all of the .py files and scan through them, replacing the hard coded strings with a standard XBMC call for localization (i.e. __language__(32001)) and create an entry in the English/strings.po file for that hard coded string. Optionally, it will then include in a trailing line comment the original text so that the code remains readable.

Features
* Scans through all python files recursively in a directory and replaces marked hard coded strings with language calls.
* Optionally adds an inline comment with the original text.
* Works with existing English/strings.po file and will add comments to existing language calls.
* Will reuse strings to prevent duplication.
* Users can exclude .py files and/or directories from scanning.
* Will not alter original files, all new files are placed in a subdirectory called 'localized' (including the strings.po file).
* In the vast majority of cases, it identifies nested and/or escaped single and double quotes.

Download link :https://github.com/KenV99/poxbmc
Further details: https://github.com/KenV99/poxbmc/wiki
Reply
#2
I added an update to github so that the settings.xml file is also scanned. No markers are needed. All label="" and lvalues="" tags are scanned. Comments with the translated strings can also be added. In addition, a report is generated showing any errors or anomalies in the files scanned. These include the absence of a localization function, missing po file entries, unused po file entries, etc.
Reply

Logout Mark Read Team Forum Stats Members Help
Po file utility for Python Addons: poxbmc.py0