xbmc / addon-check

Automatic checks for new repository submissions
GNU General Public License v3.0
52 stars 42 forks source link

Investigate what can be done for gettext .po files #145

Closed enen92 closed 5 years ago

enen92 commented 6 years ago

I think we might need some sort of validation for the language files submitted with the addons. Reason is PR https://github.com/xbmc/repo-scripts/pull/918 in which the headers for GNU gettext are missing. This leads to an error in Kodi's po parser:

10:33:59 T:2962710528  NOTICE: -->Python Interpreter Initialized<--
10:33:59 T:2962710528  NOTICE: [ADDON][WhatTheMovie] Version 1.0.10 started
10:33:59 T:58559040   ERROR: POParser: unable to read PO file header from file: /Users/me/Library/Application Support/XBMC/addons/script.game.whatthemovie/resources/language/English/strings.po
10:33:59 T:2962710528   ERROR: Previous line repeats 6 times.
10:33:59 T:2962710528  NOTICE: [ADDON][WhatTheMovie] Error:  - not all arguments converted during string formatting
10:33:59 T:2962710528  NOTICE: [ADDON][WhatTheMovie] Traceback: ['Traceback (most recent call last):\n', '  File "/Users/me/Library/Application Support/XBMC/addons/script.game.whatthemovie/resources/lib/gui.py", line 189, in onInit\n    self.login()\n', '  File "/Users/me/Library/Application Support/XBMC/addons/script.game.whatthemovie/resources/lib/gui.py", line 665, in login\n    self._showUserScore(self.score)\n', '  File "/Users/me/Library/Application Support/XBMC/addons/script.game.whatthemovie/resources/lib/gui.py", line 496, in _showUserScore\n    % (score[\'ff_score\'], score[\'all_score\']))\n', 'TypeError: not all arguments converted during string formatting\n']
10:34:13 T:2964307968 WARNING: DARWINOSX: underflow (0 vs 4096 bytes)

Is anyone familiar with a module that can help us achieving .po validation?

mzfr commented 5 years ago

@enen92 We can use polib btw what header are we talking about?

enen92 commented 5 years ago

yes I saw it. However I think we do something to validate the header in Kodi (according to the PR linked above). I didn't have time yet to check it.

mzfr commented 5 years ago
# Kodi Media Center language file
# Addon Name: kodi test addon
# Addon id: script.test
# Addon Provider: mzfr
msgid ""
msgstr ""
"Project-Id-Version: XBMC Addons\n"
"Report-Msgid-Bugs-To: alanwww1@xbmc.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-addons/language/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"

Is this the header we are talking about?

enen92 commented 5 years ago

Yes, look for the warning message in the Kodi codebase

LordGameleo commented 5 years ago

This issue has already been fixed I guess its best to to close this now.