[Mythtv-translators] Problems translating mythweb

Nicolas Riendeau knight at teksavvy.com
Wed Aug 14 02:46:51 UTC 2013


Hi Yianni!

Yianni Vidalis wrote:

 > Good hunting and many thanks,

You're welcome...

OK, I have not completed my investigation and I am not a PHP programmer 
but I think I have a pretty good idea of what is going on...

> The way it should work if I understand correctly is: The program searches the db for the value of the Category column in "Program" table. It compares it to the regular expressions in the third line, i.e. words that start with grpolice, or grmyst, or crim or myster and then shows "GRCrime_GRMystery" in mythweb.

Yep, that's what's supposed to happen...

> It doesn't work like this, though. The genre color changes successfully only if the Category column contains GRCrime_GRMystery, and it's case sensitive.

That too, surprisingly, is supposed to happen but it is supposed to be 
case insensitive...

Even before evaluating the regex on the program category it checks if 
its matches the translation (I assume that's done to avoid the overhead 
of evaluating the regex).

It's supposed to be case insensitive though... The reason why it isn't 
is the same why the pattern matching of the regex doesn't work... It's 
not able to properly convert the program category and the translation to 
lower case to see if they match (that's how the comparison is supposed 
to be made case insensitive)...

The problem is that the some the regex and strings functions used are 
not UTF-8 aware/friendly.

The PHP function preg_split is used when mb_split should be used, 
strlower (used to make the category comparison with the translation) is 
used when mb_strlower should be used.

(The "mb" prefix is for multibyte which UTF-8 use to represent a 
character as soon as it is not US-ASCII...)

There might be others, I'm still trying to find more info on the other 
regex functions used to confirm whether they are UTF-8 aware/friendly or 
if they need additional parameters or initialization (which even 
mb_strlower does) to make them work...

I'll get back to you as soon as I have more info or something to test...

Thank you and have a nice day!

Nicolas



More information about the Mythtv-translators mailing list