[mythtv-commits] mythtv/master commit: ae4a014c9 by Chris Pinkham (cpinkham)

MythTV noreply at mythtv.org
Tue Apr 26 16:51:49 UTC 2011


      Author:  Chris Pinkham <cpinkham at mythtv.org>
 Change Date:  2011-04-26T09:41:03-07:00
   Push Date:  2011/04/26 09:51:47 -0700
  Repository:  mythtv
      Branch:  master
New Revision:  ae4a014c90065e6afa02381bcc6c6a3dd0b61898
   Changeset:  https://github.com/MythTV/mythtv/commit/ae4a014c9

Log:

HTML Setup: Enable translation in mythbackend and setup menu.

Load the mythfrontend .ts file in mythbackend to enable translation
in mythbackend's HTML server.  This uses the mythfrontend .ts files
because that is what mythtv-setup uses and the primary reason for
enabling translation in the backend is to translate the backend
setup webpages being developed.  The backend normally serves only
data, not presentation, so the backend should not normally be
executing tr() to translate messages for the user.  The HTML setup
pages are different.  We want the backend to automatically translate
.qsp and .qjs files before they are presented to the user.

This patch enables translation of the menu.qsp main menu in the HTML
setup webpages.  To enable translation in other .qsp and .qjs files,
the translatable text should be wrapped in <i18n> and </i18n> opening
and closing tags.  Only .qsp and .qjs are processed for translations,
so all .html and .js files needing translation must be renamed to
.qsp and .qjs respectively.

To rebuild the htmlstrings.h file, change to the mythtv/html directory
and run ./buildhtmlstrings.sh.  Once htmlstrings.h has been
regenerated, change to the mythtv/i18n directory and run the normal
lupdate command to pull in the strings from htmlstrings.h and allow
their translation.

Since mythtv-setup is already using the mythfrontend *.ts files for
translations, there should be no new requirements for files to be
installed on a backend server via packagers because the mythfrontend
*.ts files should already be installed on both frontends and backends.

The *.ts files have not been updated as part of this commit.  There
are some strings in htmlstrings.h which are already translated in the
existing *.ts files.  This commit can be tested by changing your
Language setting, restarting mythbackend, and looking in the HTML setup
menu at options like 'General' and 'Job Queue' which already exist in
the existing *.ts files.

Added:

   mythtv/html/buildhtmlstrings.sh
   mythtv/html/getTransStringsFromFile.pl
   mythtv/html/htmlstrings.h

Modified:

   mythtv/html/menu.qsp
   mythtv/i18n/translate.pro
   mythtv/programs/mythbackend/main_helpers.cpp



More information about the mythtv-commits mailing list