Opened 20 months ago

Last modified 20 months ago

#13125 new Bug Report - General

Categories are wrong if $_SESSION['language'] does not match Xmltv language

Reported by: Francois Gouget <fgouget@…> Owned by: Stuart Auchterlonie
Priority: minor Milestone: needs_triage
Component: Plugin - MythWeb Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


So I was wondering why the categories on the 'Listings' page were all wrong. After quite a bit of digging through the code I realized that this is because my session language was set to 'English' while the program data I get comes from a French grabber so that all the categories in the MythTV database are in French.

The link is that, in modules/tv/handler.php, MythWeb uses $_SESSIONlanguage? to decide which .cat file to load. So in my case it was loading 'mythweb/modules/_shared/lang/':

if (file_exists(modules_path.'/_shared/lang/'.$_SESSIONlanguage?.'.cat'))


However the category names and regular exceptions in that file obviously don't match the French names of the categories stored in the program.category field of the MythTV database.

This resulted in category_class() returning the wrong css_class in mythweb/includes/css.php so that the 'Listings' entries were all the wrong color.

So the first bug is that MYthWeb should not assume that the user interface language is the same as that of the data in the MythTV database.

The second bug that MythTV does not store the category language in the MythTV program table (and the similar programgenres table). That's unless there is some clever way to recover some sort of global xmltv language in which case one could consider that to be sufficient. Note that all the xmltv grabbers I know of provide a language property for each entry(*). For instance:

<category lang="fr">documentaire</category>

(*) So in theory each value could be in a different language but it's likely reasonable to assume they are all in the same language.

Change History (1)

comment:1 Changed 20 months ago by sphery

Component: MythTV - Web FrontendPlugin - MythWeb
Owner: changed from stuartm to Stuart Auchterlonie
Note: See TracTickets for help on using tickets.