[mythtv] [PATCH][i18n] Selecting language and some fix

Hirobumi Shimada shimada at systemcreate-inc.com
Wed Apr 6 01:33:32 UTC 2005


Hi,
Attached patch fixed a following problems.

1. log.patch
A character code of current DB log mixed. I think that I had better
store DB log in utf8. I converted it in MythContext::LogEntry collectively.

2. lang.patch
ID is displayed instead of name by LanguageSettings.
Two questions are not reflected after having chosen a language in setup
either.

3. recpriorities_settings.xml.patch
Added Japanese resource.

Thanks,

Hiro


-------------- next part --------------
Index: programs/mythfrontend/recpriorities_settings.xml
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/recpriorities_settings.xml,v
retrieving revision 1.23
diff -u -r1.23 recpriorities_settings.xml
--- programs/mythfrontend/recpriorities_settings.xml	4 Mar 2005 19:34:33 -0000	1.23
+++ programs/mythfrontend/recpriorities_settings.xml	6 Apr 2005 01:00:08 -0000
@@ -6,9 +6,11 @@
       <text lang="DE">Aufnahmen</text>
       <text lang="SV">Inspelningsprioriteter</text>
       <text lang="FI">Nauhoitusprioriteetit</text>
+      <text lang="JA">録画優先順位設定</text>
       <alttext>Recording Priorities</alttext>
       <alttext lang="DE">Aufnahmen</alttext>
       <alttext lang="SV">Inspelning</alttext>
+      <alttext lang="JA">録画優先順位</alttext>
       <action>SETTINGS GENERALRECPRIORITIES</action>
    </button>
 
-------------- next part --------------
Index: libs/libmyth/mythcontext.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/mythcontext.cpp,v
retrieving revision 1.164
diff -u -r1.164 mythcontext.cpp
--- libs/libmyth/mythcontext.cpp	28 Mar 2005 17:53:36 -0000	1.164
+++ libs/libmyth/mythcontext.cpp	6 Apr 2005 01:00:07 -0000
@@ -2167,7 +2167,7 @@
         query.bindValue(":PRIORITY", priority);
         query.bindValue(":HOSTNAME", d->m_localhostname);
         query.bindValue(":MESSAGE", message);
-        query.bindValue(":DETAILS", details);
+        query.bindValue(":DETAILS", details.utf8());
 
         if (!query.exec() || !query.isActive())
             MythContext::DBError("LogEntry", query);
Index: libs/libmythtv/jobqueue.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/jobqueue.cpp,v
retrieving revision 1.19
diff -u -r1.19 jobqueue.cpp
--- libs/libmythtv/jobqueue.cpp	27 Mar 2005 23:53:21 -0000	1.19
+++ libs/libmythtv/jobqueue.cpp	6 Apr 2005 01:00:07 -0000
@@ -1768,10 +1768,10 @@
     QString msg = QString("Started \"%1\" for \"%2\" recorded "
                           "from channel %3 at %4")
                           .arg(jobDesc)
-                          .arg(program_info->title.local8Bit())
+                          .arg(program_info->title)
                           .arg(program_info->chanid)
                           .arg(program_info->startts.toString());
-    VERBOSE(VB_JOBQUEUE, msg);
+    VERBOSE(VB_JOBQUEUE, msg.local8Bit());
     gContext->LogEntry("jobqueue", LP_NOTICE,
                        QString("Job \"%1\" Started").arg(jobDesc), msg);
 
@@ -1790,10 +1790,10 @@
     msg = QString("Finished \"%1\" for \"%2\" recorded from "
                   "channel %3 at %4.")
                   .arg(jobDesc)
-                  .arg(program_info->title.local8Bit())
+                  .arg(program_info->title)
                   .arg(program_info->chanid)
                   .arg(program_info->startts.toString());
-    VERBOSE(VB_JOBQUEUE, msg);
+    VERBOSE(VB_JOBQUEUE, msg.local8Bit());
 
     gContext->LogEntry("jobqueue", LP_NOTICE,
                        QString("Job \"%1\" Finished").arg(jobDesc), msg);
Index: programs/mythbackend/scheduler.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythbackend/scheduler.cpp,v
retrieving revision 1.142
diff -u -r1.142 scheduler.cpp
--- programs/mythbackend/scheduler.cpp	4 Apr 2005 04:14:33 -0000	1.142
+++ programs/mythbackend/scheduler.cpp	6 Apr 2005 01:00:07 -0000
@@ -1101,7 +1101,7 @@
                 .arg(nextRecording->sourceid);
             VERBOSE(VB_GENERAL, msg.local8Bit());
             gContext->LogEntry("scheduler", LP_NOTICE, "Schedule Change", 
-                               msg.utf8());
+                               msg);
         }
 
         if (statuschanged)
Index: programs/mythfilldatabase/filldata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.163
diff -u -r1.163 filldata.cpp
--- programs/mythfilldatabase/filldata.cpp	4 Apr 2005 16:47:37 -0000	1.163
+++ programs/mythfilldatabase/filldata.cpp	6 Apr 2005 01:00:08 -0000
@@ -2294,7 +2294,7 @@
                         {
                             cerr << "removing existing program: "
                                  << (*i).channel.local8Bit() << " "
-                                 << query.value(0).toString().local8Bit() << " "
+                                 << QString::fromUtf8(query.value(0).toString()).local8Bit() << " "
                                  << query.value(1).toDateTime().toString(Qt::ISODate) << " - "
                                  << query.value(2).toDateTime().toString(Qt::ISODate) << endl;
                         }
Index: programs/mythfrontend/statusbox.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/statusbox.cpp,v
retrieving revision 1.20
diff -u -r1.20 statusbox.cpp
--- programs/mythfrontend/statusbox.cpp	26 Mar 2005 15:37:41 -0000	1.20
+++ programs/mythfrontend/statusbox.cpp	6 Apr 2005 01:00:08 -0000
@@ -775,7 +775,7 @@
             contentLines[count] = line;
 
             if (query.value(6).toString() != "")
-                line = QString("On %1 %2 from %3.%4\n%5\n%6")
+                line = tr("On %1 %2 from %3.%4\n%5\n%6")
                                .arg(query.value(3).toDateTime()
                                          .toString(dateFormat))
                                .arg(query.value(3).toDateTime()
@@ -783,9 +783,9 @@
                                .arg(query.value(4).toString())
                                .arg(query.value(1).toString())
                                .arg(query.value(5).toString())
-                               .arg(query.value(6).toString());
+                               .arg(QString::fromUtf8(query.value(6).toString()));
             else
-                line = QString("On %1 %2 from %3.%4\n%5\nNo other details")
+                line = tr("On %1 %2 from %3.%4\n%5\nNo other details")
                                .arg(query.value(3).toDateTime()
                                          .toString(dateFormat))
                                .arg(query.value(3).toDateTime()
-------------- next part --------------
Index: libs/libmyth/langsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/langsettings.cpp,v
retrieving revision 1.4
diff -u -r1.4 langsettings.cpp
--- libs/libmyth/langsettings.cpp	23 Feb 2005 05:04:35 -0000	1.4
+++ libs/libmyth/langsettings.cpp	6 Apr 2005 01:00:06 -0000
@@ -145,7 +145,6 @@
           << QString::fromUtf8("Dansk")       << "DK"   // Danish
           << QString::fromUtf8("Svenska")     << "SV"   // Swedish
           << QString::fromUtf8("Português")   << "PT"   // Portuguese
-       // << QString::fromUtf8("日本語")   << "JA"   // Japanese
           << QString::fromUtf8("Nihongo")     << "JA"   // Japanese
           << QString::fromUtf8("Slovenski")   << "SI"   // Slovenian
           << QString::fromUtf8("Suomi")       << "FI"   // Finnish
@@ -160,7 +159,9 @@
     widget->clearSelections();
     for (QStringList::Iterator it = langs.begin(); it != langs.end(); ++it)
     {
-        widget->addSelection(*it, *(++it));
+        QString label = *it;
+        QString value = *(++it);
+        widget->addSelection(label, value);
     }
 }
 
Index: setup/main.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/setup/main.cpp,v
retrieving revision 1.55
diff -u -r1.55 main.cpp
--- setup/main.cpp	5 Apr 2005 06:00:11 -0000	1.55
+++ setup/main.cpp	6 Apr 2005 01:00:08 -0000
@@ -176,8 +176,6 @@
 
     UpgradeTVDatabaseSchema();
 
-    LanguageSettings::load("mythfrontend");
-
     gContext->SetSetting("Theme", "blue");
     gContext->LoadQtConfig();
 
@@ -190,7 +188,9 @@
     MythMainWindow *mainWindow = new MythMainWindow();
     mainWindow->Show();
     gContext->SetMainWindow(mainWindow);
+
     LanguageSettings::prompt();
+    LanguageSettings::load("mythfrontend");
 
     DialogBox dboxCard(mainWindow, QObject::tr("Would you like to clear all "
                                    "capture card settings before starting "


More information about the mythtv-dev mailing list