Loggytronic Forum

VOMP => VOMP for Raspberry Pi => Topic started by: JTe on October 06, 2012, 21:55:33

Title: A couple of internationalisation fixes
Post by: JTe on October 06, 2012, 21:55:33
I was making the new translation files for raspi vomp client and found a couple of very old bugs (missing tr() calls).

Also the use of the word "Advanced" in Settings menu and in the interlacing mode settings makes translations difficult as the "Advanced settings" and "Advanced mode" do often translate with different pharses in different languages. So I suggest using "Advanced options" in the main Settings menu, or changing the interlacing settings mode to something else than "Advanced".

Here is a small patch to fix those internationalisation problems:

diff -rupN vompclient-raspi/vopts.cc vompclient-raspi-jte/vopts.cc
--- vompclient-raspi/vopts.cc   2012-09-28 19:05:59.847817353 +0300
+++ vompclient-raspi-new/vopts.cc       2012-09-29 18:56:41.457261467 +0300
@@ -156,7 +156,7 @@ VOpts::VOpts()

     
   wop = new WOptionPane();
-  tabbar.addTab(tr("Advanced"), wop);
+  tabbar.addTab(tr("Advanced Options"), wop);
   panes[2] = wop;
   
   option = new Option(8, "VDR-Pri 0=OK !See forums!",  "General",  "Live priority",      Option::TYPE_INT,  100, 0, 0, NULL);

--- ../vompclient-raspi/vtimeredit.cc   2012-09-28 19:05:59.877819822 +0300
+++ ../vompclient-raspi-new/vtimeredit.cc       2012-10-04 10:57:34.332083718 +0300
@@ -48,9 +48,9 @@
   selectedButton = 0;
   buttonBack.setPosition(30,350);
   buttonDelete.setPosition(400,350);
-  buttonBack.setText("Back");
+  buttonBack.setText(tr("Back"));
   buttonBack.setActive(1);
-  buttonDelete.setText("Delete");
+  buttonDelete.setText(tr("Delete"));
   add(&buttonBack);
   add(&buttonDelete);

@@ -96,8 +96,8 @@
   ypos = 50;

   // Active
-  if (recTimer->active) strcpy(buffer, "Yes");
-  else                  strcpy(buffer, "No");
+  if (recTimer->active) strcpy(buffer, tr("Yes"));
+  else                  strcpy(buffer, tr("No"));
   drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT);         ypos += fontheight;

   // Channel
@@ -134,13 +134,13 @@
                                                            ypos += fontheight;

   // Current
-  if (recTimer->pending) strcpy(buffer, "Yes");
-  else                   strcpy(buffer, "No");
+  if (recTimer->pending) strcpy(buffer, tr("Yes"));
+  else                   strcpy(buffer, tr("No"));
   drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT);         ypos += fontheight;

   // Recording now
-  if (recTimer->recording) strcpy(buffer, "Yes");
-  else                     strcpy(buffer, "No");
+  if (recTimer->recording) strcpy(buffer, tr("Yes"));
+  else                     strcpy(buffer, tr("No"));
   drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT);         ypos += fontheight;
}

@@ -209,8 +209,8 @@
       v->setTitleBarColour(DrawStyle::DANGER);
       v->setTitleBarOn(1);
       v->setBorderOn(1);
-      v->setTitleText("Delete timer");
-      v->setMainText("Are you sure you want to delete this timer?");
+      v->setTitleText(tr("Delete timer"));
+      v->setMainText(tr("Are you sure you want to delete this timer?"));
       v->setDefault(VQuestion::NO);
       if (Video::getInstance()->getFormat() == Video::PAL)
         v->setPosition(230, 160);
Title: Re: A couple of internationalisation fixes
Post by: MartenR on October 07, 2012, 10:16:47
I have put all your changes, except for the Advanced to Advanced Options suggestion to git.
The reason for not changing the Advanced Options is, that the title would be too big for mvp and windows client...

Marten
Title: Re: A couple of internationalisation fixes
Post by: JTe on October 07, 2012, 20:34:51
Thanks for the update. I see the problem with the "Advanced" vs "Advanced Options". How about changing the interlace option "Advanced" to "Advanced 1x" or "advanced" with a lower case "a" or similar to avoid the translation problem (I did not check the code if it is closer to Advanced 1x or 2x or something else...)?