[mythtv-commits] Ticket #13125: Categories are wrong if $_SESSION['language'] does not match Xmltv language
MythTV
noreply at mythtv.org
Sun Sep 17 23:12:50 UTC 2017
#13125: Categories are wrong if $_SESSION['language'] does not match Xmltv language
---------------------------------------------+--------------------------
Reporter: Francois Gouget <fgouget@…> | Owner: stuartm
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: MythTV - Web Frontend | Version: Master Head
Severity: medium | Keywords:
Ticket locked: 0 |
---------------------------------------------+--------------------------
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
$_SESSION['language'] to decide which .cat file to load. So in my case it
was loading 'mythweb/modules/_shared/lang/English.cat':
if
(file_exists(modules_path.'/_shared/lang/'.$_SESSION['language'].'.cat'))
load_tv_categories(modules_path.'/_shared/lang/'.$_SESSION['language'].'.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.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13125>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list