view.o vinfo.o vwallpaper.o vvolume.o vrecordinglist.o vlivebanner.o vmute.o \
vrecordingmenu.o vquestion.o vchannellist.o vwelcome.o vvideolive.o vvideorec.o vradiolive.o \
vchannelselect.o vserverselect.o colour.o vconnect.o voptions.o \
- widget.o wselectlist.o wjpeg.o wsymbol.o wbutton.o woptionbox.o \
+ widget.o wselectlist.o wjpeg.o wsymbol.o wbutton.o woptionbox.o i18n.o \
fonts/helvB24.o fonts/helvB18.o
.PHONY: clean fresh all install strip
void Command::doJustConnected(VConnect* vconnect)
{
+ I18n::Initialize();
Video* video = Video::getInstance();
viewman->removeView(vconnect, 0, 1);
else
vi->setScreenPos(160, 150);
- vi->setMainText("\n Connected, loading config");
+ vi->setMainText(tr("\n Connected, loading config"));
vi->draw();
vi->show();
viewman->add(vi);
#include "vmute.h"
#include "colour.h"
#include "osd.h"
+#include "i18n.h"
class VConnect;
--- /dev/null
+/*\r
+ * i18n.c: Internationalization\r
+ *\r
+ * This code is taken from the VDR project and modified for VOMP.\r
+ * See the main source file 'vdr.c' for original copyright information.\r
+ * Modifications (C) 2005 D Pickles.\r
+\r
+ This file is part of VOMP.\r
+\r
+ VOMP is free software; you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation; either version 2 of the License, or\r
+ (at your option) any later version.\r
+\r
+ VOMP is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with VOMP; if not, write to the Free Software\r
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+*/\r
+\r
+/*\r
+ * How to add a new language:\r
+ *\r
+ * 1. Announce your translation action on the VOMP mailing\r
+ * list to avoid duplicate work.\r
+ * 2. Increase the value of 'NUM_LANGUAGES' in i18n.h.\r
+ * 3. Insert a new line in the 'Languages' array containing the name of your\r
+ * language IN YOUR LANGUAGE, so 'Italiano' not 'Italian' for example.\r
+ * Append your language after the last existing language\r
+ * but before the 'test' language\r
+ * 4. Insert a new line in the charSets array containing the name of the character\r
+ * set needed for your language. Note that at present only ISO8859-1 is\r
+ * supported\r
+ * 5. Insert a new line in the languageCodes array containing the 3-letter\r
+ * abbreviation(s) for your language as used in the channels.conf.\r
+ * 6. Insert a line in evry member of the 'Phrases[]' array,\r
+ * containing the translated text for your language. You can use the 'test'\r
+ * language to see where the phrases appear on the screen.\r
+ * 7. Add the name of your language to the i18nLanguages array in voptions.h.\r
+ * 8. If your language requires a character set other than the default iso8859-1\r
+ * then work will be needed elsewhere in vomp to manage multiple font files.\r
+ * 9. Compile VOMP and test the new language by switching to it\r
+ * in the "Options" menu.\r
+ *10. Send the modified files to Chris to have it included in the next version.\r
+ *\r
+ * In case an English phrase is used in more than one context (and might need\r
+ * different translations in other languages) it can be preceeded with an\r
+ * arbitrary string to describe its context, separated from the actual phrase\r
+ * by a '$' character (see for instance "Button$Stop" vs. "Stop").\r
+ * Of course this means that no English phrase may contain the '$' character!\r
+ * If this should ever become necessary, the existing '$' would have to be\r
+ * replaced with something different...\r
+ */\r
+\r
+#include "i18n.h"\r
+#include "log.h"\r
+#include "vdr.h"\r
+\r
+ // The names of the languages (English MUST be first!):\r
+static char *Languages[] =\r
+ { "English",\r
+ "Test"\r
+ };\r
+\r
+ // The character set needed for each language:\r
+const static char *charSets[] =\r
+ { "iso8859-1",\r
+ "iso8859-1"\r
+ };\r
+\r
+ // The 3-letter names of the language (this MUST be the third phrase!):\r
+const char *languageCodes[] =\r
+ { "eng,dos",\r
+ "tst,xxx"\r
+ };\r
+\r
+ // The phrases to be translated:\r
+\r
+const static tI18nPhrase Phrases[] = {\r
+ // Menu titles:\r
+ { "VDR",\r
+ "VDR",\r
+ },\r
+ { "Schedule",\r
+ "0",\r
+ },\r
+ // Welcome screen\r
+ { "Welcome",\r
+ "1",\r
+ },\r
+ { "1. Live TV",\r
+ "2",\r
+ },\r
+ { "2. Radio",\r
+ "3",\r
+ },\r
+ { "3. Recordings",\r
+ "4",\r
+ },\r
+ { "4. Options",\r
+ "5",\r
+ },\r
+ { "5. Stand by",\r
+ "6",\r
+ },\r
+ { "6. Reboot",\r
+ "7",\r
+ },\r
+ { "\n Downloading recordings list",\r
+ "8",\r
+ },\r
+ // Recordings list\r
+ { "Recordings - %s",\r
+ "9 - %s",\r
+ },\r
+ { "Recordings",\r
+ "10",\r
+ },\r
+ { "<dir> %lu\t%s",\r
+ "11 %lu\t%s",\r
+ },\r
+ { "[ok] = menu",\r
+ "12",\r
+ },\r
+ { "%lu%% used, %iGB free",\r
+ "13 %lu%% %i",\r
+ },\r
+ { "%i to %i of %i", // Also used in channels list\r
+ "14 %i %i %i",\r
+ },\r
+ // Question\r
+ { "Yes",\r
+ "15",\r
+ },\r
+ { "No",\r
+ "16",\r
+ },\r
+ // Recording Menu\r
+ { "Programme menu",\r
+ "17",\r
+ },\r
+ { "Play",\r
+ "18",\r
+ },\r
+ { "Resume",\r
+ "19",\r
+ },\r
+ { "Summary",\r
+ "20",\r
+ },\r
+ { "Delete",\r
+ "21",\r
+ },\r
+ { "Programme summary",\r
+ "22",\r
+ },\r
+ { "Summary unavailable",\r
+ "23",\r
+ },\r
+ { "Delete recording",\r
+ "24",\r
+ },\r
+ { "Are you sure you want to delete this recording?",\r
+ "25",\r
+ },\r
+ // Server select\r
+ { "Choose a VDR server",\r
+ "26",\r
+ },\r
+\r
+ // Option menus\r
+ { "Options",\r
+ "27",\r
+ },\r
+ { "TV connection type",\r
+ "28",\r
+ },\r
+ { "Remote control type",\r
+ "29",\r
+ },\r
+ { "TV aspect ratio",\r
+ "30",\r
+ },\r
+ { "16:9 on 4:3 display mode",\r
+ "30a",\r
+ },\r
+ { "Power state after bootup",\r
+ "31",\r
+ },\r
+ { "Display channels",\r
+ "32",\r
+ },\r
+ { "Language",\r
+ "33",\r
+ },\r
+ { "Press back to exit, <, > or [ok] to change",\r
+ "34",\r
+ },\r
+ { "VDR-Pri 0=OK !See forums!",\r
+ "34a",\r
+ },\r
+ // Option choices\r
+ { "Old",\r
+ "35",\r
+ },\r
+ { "New",\r
+ "36",\r
+ },\r
+ { "RGB+composite",\r
+ "37",\r
+ },\r
+ { "S-Video",\r
+ "38",\r
+ },\r
+ { "Chop sides",\r
+ "39",\r
+ },\r
+ { "Letterbox",\r
+ "40",\r
+ },\r
+ { "Last state",\r
+ "41",\r
+ },\r
+ { "All",\r
+ "42",\r
+ },\r
+ { "FTA only",\r
+ "43",\r
+ },\r
+ { "On",\r
+ "44",\r
+ },\r
+ { "Off",\r
+ "45",\r
+ },\r
+\r
+ // Channel Lists\r
+ { "Channels",\r
+ "46",\r
+ },\r
+ { "Radio Stations",\r
+ "47",\r
+ },\r
+ // Banners\r
+ { "No channel data available",\r
+ "48",\r
+ },\r
+ { "info",\r
+ "49",\r
+ },\r
+ { "info",\r
+ "50",\r
+ },\r
+ { "\n Channel unavailable",\r
+ "51",\r
+ },\r
+ // Connect screen\r
+ { "\n Locating server",\r
+ "52",\r
+ },\r
+ { "\n Connecting to VDR",\r
+ "53",\r
+ },\r
+ { "\n Login failed",\r
+ "54",\r
+ },\r
+ { "\n Connection failed",\r
+ "55",\r
+ },\r
+ // Command\r
+ { "\n Connected, loading config",\r
+ "56",\r
+ },\r
+ // End marker.\r
+ { NULL }\r
+ };\r
+\r
+ static int LanguageID = INITIAL_LANGUAGE_INDEX;\r
+\r
+\r
+int I18n::Initialize(void) {\r
+\r
+ VDR *vdr = VDR::getInstance();\r
+ char *lang = vdr->configLoad("General", "Language");\r
+ if (lang) {\r
+ LanguageID = LanguageIndex(lang);\r
+ if (LanguageID == -1) {\r
+ LanguageID = 0;\r
+ }\r
+ }\r
+ else {\r
+ LanguageID = LanguageIndex(INITIAL_LANGUAGE);\r
+ }\r
+ return LanguageID;\r
+}\r
+\r
+char *I18n::Translate(char *s)\r
+{\r
+ if (LanguageID >= 0) {\r
+ const tI18nPhrase *p = Phrases;\r
+ for (int i = ((p == Phrases) ? 1 : 2); i--; ) {\r
+ for (; **p; p++) {\r
+ if (strcmp(s, **p) == 0) {\r
+ char *t = (*p)[LanguageID];\r
+ if (t && *t) return t;\r
+ }\r
+ }\r
+ p = Phrases;\r
+ }\r
+ Log::getInstance()->log("I18n", Log::ERR, "no translation found for '%s' in language %d (%s)\n",\r
+ s, LanguageID, LanguageName(LanguageID));\r
+ }\r
+ char *p = strchr(s, '$');\r
+ return p ? p + 1 : s;\r
+}\r
+\r
+const char * const * I18n::CharSets(void)\r
+{\r
+ return charSets;\r
+}\r
+\r
+const char * I18n::LanguageCode(int Index)\r
+{\r
+ return 0 <= Index && Index < I18nNumLanguages ? languageCodes[Index] : NULL;\r
+}\r
+\r
+char * I18n::LanguageName(int Index)\r
+{\r
+ return 0 <= Index && Index < I18nNumLanguages ? Languages[Index] : NULL;\r
+}\r
+\r
+int I18n::LanguageIndex(const char *Name)\r
+{\r
+ for (int i = 0; i < I18nNumLanguages; i++) {\r
+ if (strcasestr(Languages[i], Name))\r
+ return i;\r
+ }\r
+ Log::getInstance()->log("I18n", Log::ERR, "unknown language: '%s'", Name);\r
+ return -1;\r
+}\r
+\r
+int I18n::GetNumLanguages(void) {\r
+ return I18nNumLanguages;\r
+}\r
+\r
--- /dev/null
+/*\r
+ * i18n.h: Internationalization\r
+ *\r
+ * This code is taken from the VDR project and modified for VOMP.\r
+ * See the main source file 'vdr.c' for original copyright information.\r
+ * Modifications (C) 2005 D Pickles.\r
+\r
+ This file is part of VOMP.\r
+\r
+ VOMP is free software; you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation; either version 2 of the License, or\r
+ (at your option) any later version.\r
+\r
+ VOMP is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with VOMP; if not, write to the Free Software\r
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+#ifndef __I18N_H\r
+#define __I18N_H\r
+\r
+#include <stdio.h>\r
+\r
+#define NUM_LANGUAGES 2\r
+#define INITIAL_LANGUAGE "English"\r
+#define INITIAL_LANGUAGE_INDEX 0\r
+#define tr(s) I18n::Translate(s)\r
+\r
+\r
+typedef char *tI18nPhrase[NUM_LANGUAGES];\r
+\r
+\r
+class I18n\r
+{\r
+ public:\r
+ static char *Translate(char *s);\r
+ const char * const * CharSets(void);\r
+ const char * LanguageCode(int Index);\r
+ static int Initialize(void);\r
+\r
+ static char * LanguageName(int Index);\r
+ static int LanguageIndex(const char *Name);\r
+ static int GetNumLanguages(void);\r
+\r
+ private:\r
+\r
+ const static int I18nNumLanguages = NUM_LANGUAGES;\r
+};\r
+\r
+\r
+#endif //__I18N_H\r
+\r
else if (videoFormat == Video::NTSC) logger->log("Core", Log::INFO, "Read from MTD: NTSC 720x480");
else logger->log("Core", Log::INFO, "No help from MTD. Assuming NTSC 720x480");
+ //videoFormat = Video::NTSC; // enable this line to test NTSC in PAL land
+
success = video->init(videoFormat);
if (success)
{
if (type == VDR::VIDEO)
{
- setTitleText("Channels");
+ setTitleText(tr("Channels"));
}
else if (type == VDR::RADIO)
{
- setTitleText("Radio Stations");
+ setTitleText(tr("Radio Stations"));
}
setTitleBarColour(Colour::TITLEBARBACKGROUND);
if (sl.getNumOptions() == 0) topOption = 0;
char showing[200];
- sprintf(showing, "%i to %i of %i", topOption, sl.getBottomOption(), sl.getNumOptions());
+ sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
// Box b;
// b.setSurfaceOffset(220, 385);
#include "vradiolive.h"
#include "colour.h"
#include "video.h"
+#include "i18n.h"
class VChannelList : public View
{
do
{
- setMainText("\n Locating server");
+ setMainText(tr("\n Locating server"));
draw();
show();
for(UINT k = 0; k < serverIPs.size(); k++) delete[] serverIPs[k];
serverIPs.clear();
- setMainText("\n Connecting to VDR");
+ setMainText(tr("\n Connecting to VDR"));
draw();
show();
else
{
vdr->disconnect();
- setMainText("\n Login failed");
+ setMainText(tr("\n Login failed"));
ts.tv_sec = 3;
ts.tv_nsec = 0;
}
}
else
{
- setMainText("\n Connection failed");
+ setMainText(tr("\n Connection failed"));
ts.tv_sec = 3;
ts.tv_nsec = 0;
}
#include "colour.h"
#include "video.h"
#include "thread.h"
+#include "i18n.h"
class VConnect : public VInfo, public Thread
{
return toReturn;
}
-int VDR::configSave(char* section, char* key, char* value)
+int VDR::configSave(char* section, char* key, const char* value)
{
if (!connected) return 0;
UCHAR* getBlock(ULLONG position, UINT maxAmount, UINT* amountReceived);
int stopStreaming();
EventList* getChannelSchedule(ULONG number);
- int configSave(char* section, char* key, char* value);
+ int configSave(char* section, char* key, const char* value);
char* configLoad(char* section, char* key);
// end
if (!eventList)
{
- sl.addOption("No channel data available", 1);
+ sl.addOption(tr("No channel data available"), 1);
}
else
{
rectangle(0, height - 30, width, 30, titleBarColour);
rectangle(7, height - 24, 18, 16, Colour::RED);
- drawText("info", 32, height - 25, Colour::LIGHTTEXT);
+ drawText(tr("info"), 32, height - 25, Colour::LIGHTTEXT);
}
int VLiveBanner::handleCommand(int command)
vi->setBorderOn(1);
vi->setExitable();
if (event->description) vi->setMainText(event->description);
- else vi->setMainText("Summary unavailable");
+ else vi->setMainText(tr("Summary unavailable"));
if (Video::getInstance()->getFormat() == Video::PAL)
{
vi->setScreenPos(120, 130);
#include "event.h"
#include "vinfo.h"
#include "viewman.h"
+#include "i18n.h"
class VLiveBanner : public View
{
VOptions::VOptions()
{
- create(500, 285);
+ create(500, 75+(NUM_OPTIONS*30));
if (Video::getInstance()->getFormat() == Video::PAL)
{
setScreenPos(120, 140);
}
else
{
- setScreenPos(110, 110);
+ setScreenPos(110, 80);
}
setBackgroundColour(Colour::VIEWBACKGROUND);
setTitleBarOn(1);
setTitleBarColour(Colour::TITLEBARBACKGROUND);
- setTitleText("Options");
+ setTitleText(tr("Options"));
int fontHeight = surface->getFontHeight();
{
Log::getInstance()->log("Options", Log::DEBUG, "Add option");
Log::getInstance()->log("Options", Log::DEBUG, "Add option: %s", optionData[i].options[j]);
- optionBox[i].addOption(optionData[i].options[j]);
+ optionBox[i].addOption(tr(optionData[i].options[j]));
Log::getInstance()->log("Options", Log::DEBUG, "Done add option");
}
}
for (i = 0; i < numOptions; i++)
{
- optionBox[i].setSelected(optionData[i].options[optionData[i].defaultOption]);
+ optionBox[i].setSelected(tr(optionData[i].options[optionData[i].defaultOption]));
config = vdr->configLoad(optionData[i].configSection, optionData[i].configParam);
if (config)
{
{
if (!strcasecmp(config, optionData[i].options[j]))
{
- optionBox[i].setSelected(optionData[i].options[j]);
+ optionBox[i].setSelected(tr(optionData[i].options[j]));
}
}
delete[] config;
WSymbol wsy;
Colour cl;
- drawText("Press back to exit, <, > or [ok] to change", 10, 255, Colour::LIGHTTEXT);
+ drawText(tr("Press back to exit, <, > or [ok] to change"), 10, 45+numOptions*30, Colour::LIGHTTEXT);
wsy.setSurface(surface);
for (UINT i = 0; i < numOptions; i++)
{
- drawText(optionData[i].title, 10, 45+i*30, Colour::LIGHTTEXT);
+ drawText(tr(optionData[i].title), 10, 45+i*30, Colour::LIGHTTEXT);
if (i == selectedOption) cl = Colour::SELECTHIGHLIGHT;
else cl = Colour::BUTTONBACKGROUND;
void VOptions::doSave()
{
- char* result[numOptions];
+ int result[numOptions];
for (UINT i = 0; i < numOptions; i++)
{
- result[i] = optionBox[i].getSelected();
- vdr->configSave(optionData[i].configSection, optionData[i].configParam, result[i]);
+ result[i] = optionBox[i].getSelectedIndex();
+ vdr->configSave(optionData[i].configSection, optionData[i].configParam,
+ optionData[i].options[result[i]]);
}
// Apply changes
Video* video = Video::getInstance();
- if (!strcmp(result[0], optionData[0].options[1]))
+ if (result[0] == 1)
{
Log::getInstance()->log("Options", Log::DEBUG, "Setting New Remote");
Remote::getInstance()->setRemoteType(Remote::NEWREMOTE);
Remote::getInstance()->setRemoteType(Remote::OLDREMOTE);
}
- if (!strcmp(result[1], optionData[1].options[1]))
+ if (result[2] == 1)
{
Log::getInstance()->log("Options", Log::DEBUG, "Setting S-Video");
video->setConnection(Video::SVIDEO);
video->setConnection(Video::COMPOSITERGB);
}
- if (!strcmp(result[2], optionData[2].options[1]))
+ if (result[3] == 1)
{
Log::getInstance()->log("Options", Log::DEBUG, "Setting 16:9 TV");
video->setTVsize(Video::ASPECT16X9);
video->setTVsize(Video::ASPECT4X3);
}
- if (!strcmp(result[3], optionData[3].options[1]))
+ if (result[4] == 1)
{
Log::getInstance()->log("Options", Log::DEBUG, "Setting letterbox");
video->setMode(Video::LETTERBOX);
Log::getInstance()->log("Options", Log::DEBUG, "Setting chop-sides");
video->setMode(Video::NORMAL);
}
-
+ I18n::Initialize();
}
#include "video.h"
#include "woptionbox.h"
#include "wsymbol.h"
+#include "i18n.h"
-#define NUM_OPTIONS 7
+#define NUM_OPTIONS 8
typedef struct
{
char *title; // Name of the option
char *configParam; // Parameter name in the config file
UINT optionCount; // How many choices?
UINT defaultOption; // Serial of the default choice (base 0)
- const char **options; // Text for the options
+ char **options; // Text for the options
} OPTIONDATA;
-const static char* options0[] = {"Old", "New"};
-const static char* options1[] = {"RGB+composite", "S-Video"};
-const static char* options2[] = {"4:3", "16:9"};
-const static char* options3[] = {"Chop sides", "Letterbox"};
-const static char* options4[] = {"On", "Off", "Last state"};
-const static char* options5[] = {"All", "FTA only"};
-const static char* options6[] = {"0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "99"};
+static char* options0[] = {"Old", "New"};
+static char* options1[] = {"RGB+composite", "S-Video"};
+static char* options2[] = {"4:3", "16:9"};
+static char* options3[] = {"Chop sides", "Letterbox"};
+static char* options4[] = {"On", "Off", "Last state"};
+static char* options5[] = {"All", "FTA only"};
+static char* options6[] = {"0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "99"};
+static char *i18nLanguages[] = { "English", "Test" };
const static OPTIONDATA optionData[NUM_OPTIONS] =
{
{"Remote control type", "General", "Remote type", 2, 0, options0 },
+ {"Language", "General", "Language", NUM_LANGUAGES, 0, i18nLanguages },
{"TV connection type", "TV", "Connection", 2, 0, options1 },
{"TV aspect ratio", "TV", "Aspect", 2, 0, options2 },
{"16:9 on 4:3 display mode", "TV", "Widemode", 2, 0, options3 },
buttonYes.setSurfaceOffset(40, 120);
buttonNo.setSurfaceOffset(140, 120);
- buttonYes.setText("Yes");
- buttonNo.setText("No");
+ buttonYes.setText(tr("Yes"));
+ buttonNo.setText(tr("No"));
buttonNo.setActive(1);
}
#include "remote.h"
#include "viewman.h"
#include "colour.h"
+#include "i18n.h"
class VQuestion : public View
{
char title[300];
if (!recDir->isRoot)
{
- snprintf(title, 299, "Recordings - %s", recDir->name);
+ snprintf(title, 299, tr("Recordings - %s"), recDir->name);
setTitleText(title);
}
else
{
- setTitleText("Recordings");
+ setTitleText(tr("Recordings"));
}
}
for (i = recDir->dirList.begin(); i != recDir->dirList.end(); i++)
{
dir = *i;
- snprintf(tempA, 299, "<dir> %lu\t%s", dir->getNumRecordings(), dir->name);
+ snprintf(tempA, 299, tr("<dir> %lu\t%s"), dir->getNumRecordings(), dir->name);
dir->index = sl.addOption(tempA, first);
first = 0;
}
w.draw();
// FIXME Right justify this!
- drawText("[ok] = menu", 450, 385, Colour::LIGHTTEXT);
+ drawText(tr("[ok] = menu"), 450, 385, Colour::LIGHTTEXT);
doShowingBar();
char freeSpace[50];
int gigFree = Directory::freeSpace / 1024;
- snprintf(freeSpace, 49, "%lu%% used, %iGB free", Directory::usedPercent, gigFree);
+ snprintf(freeSpace, 49, tr("%lu%% used, %iGB free"), Directory::usedPercent, gigFree);
drawTextRJ(freeSpace, 560, 5, Colour::LIGHTTEXT);
}
if (sl.getNumOptions() == 0) topOption = 0;
char showing[200];
- sprintf(showing, "%i to %i of %i", topOption, sl.getBottomOption(), sl.getNumOptions());
+ sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
// Box b;
// b.setSurfaceOffset(220, 385);
#include "vvideorec.h"
#include "colour.h"
#include "video.h"
+#include "i18n.h"
class VRecordingList : public View
{
setBackgroundColour(Colour::VIEWBACKGROUND);
setTitleBarOn(1);
setBorderOn(1);
- setTitleText("Programme menu");
+ setTitleText(tr("Programme menu"));
setTitleBarColour(Colour::TITLEBARBACKGROUND);
sl.setSurface(surface);
sl.setSurfaceOffset(10, 30 + 5);
sl.setDimensions(width - 20, height - 30 - 15);
- sl.addOption("Play", 1);
- sl.addOption("Resume", 0);
- sl.addOption("Summary", 0);
- sl.addOption("Delete", 0);
+ sl.addOption(tr("Play"), 1);
+ sl.addOption(tr("Resume"), 0);
+ sl.addOption(tr("Summary"), 0);
+ sl.addOption(tr("Delete"), 0);
}
VRecordingMenu::~VRecordingMenu()
char* summary = VDR::getInstance()->getRecordingSummary(rec->fileName);
VInfo* vi = new VInfo();
- vi->setTitleText("Programme summary");
+ vi->setTitleText(tr("Programme summary"));
vi->setBorderOn(1);
vi->setExitable();
if (summary) vi->setMainText(summary);
- else vi->setMainText("Summary unavailable");
+ else vi->setMainText(tr("Summary unavailable"));
if (Video::getInstance()->getFormat() == Video::PAL)
{
vi->setScreenPos(120, 130);
v->setTitleBarColour(Colour::DANGER);
v->setTitleBarOn(1);
v->setBorderOn(1);
- v->setTitleText("Delete recording");
- v->setMainText("Are you sure you want to delete this recording?");
+ v->setTitleText(tr("Delete recording"));
+ v->setMainText(tr("Are you sure you want to delete this recording?"));
v->setDefault(VQuestion::NO);
if (Video::getInstance()->getFormat() == Video::PAL)
{
#include "vdr.h"
#include "colour.h"
#include "video.h"
+#include "i18n.h"
class VRecordingList;
setBackgroundColour(Colour::VIEWBACKGROUND);
setTitleBarOn(1);
setTitleBarColour(Colour::TITLEBARBACKGROUND);
- setTitleText("Choose a VDR server");
+ setTitleText(tr("Choose a VDR server"));
sl.setSurface(surface);
sl.setSurfaceOffset(10, 30 + 5);
#include "colour.h"
#include "video.h"
#include "viewman.h"
+#include "i18n.h"
class VServerSelect : public View
{
unavailableView->setScreenPos(160, 150);
}
unavailableView->setTitleText((*chanList)[currentChannel]->name);
- unavailableView->setMainText("\n Channel unavailable");
+ unavailableView->setMainText(tr("\n Channel unavailable"));
unavailableView->setDropThrough();
Message* m = new Message();
#include "osd.h"
#include "vinfo.h"
#include "command.h"
+#include "i18n.h"
class VVideoLive : public View
{
setBackgroundColour(Colour::VIEWBACKGROUND);
setTitleBarOn(1);
setTitleBarColour(Colour::TITLEBARBACKGROUND);
- setTitleText("Welcome");
+ setTitleText(tr("Welcome"));
sl.setSurfaceOffset(20, 40);
sl.setDimensions(170, 140);
- sl.addOption("1. Live TV", 1);
- sl.addOption("2. Radio", 0);
- sl.addOption("3. Recordings", 0);
- sl.addOption("4. Options", 0);
- sl.addOption("5. Stand by", 0);
- sl.addOption("6. Reboot", 0);
+ sl.addOption(tr("1. Live TV"), 1);
+ sl.addOption(tr("2. Radio"), 0);
+ sl.addOption(tr("3. Recordings"), 0);
+ sl.addOption(tr("4. Options"), 0);
+ sl.addOption(tr("5. Stand by"), 0);
+ sl.addOption(tr("6. Reboot"), 0);
jpeg.setSurfaceOffset(240, 60);
}
{
viewWait->setScreenPos(130, 140);
}
- viewWait->setMainText("\n Downloading recordings list");
+ viewWait->setMainText(tr("\n Downloading recordings list"));
viewWait->draw();
viewWait->show();
viewman->addNoLock(viewWait);
#include "colour.h"
#include "video.h"
#include "voptions.h"
+#include "i18n.h"
class VWelcome : public View
{
{
return options[currentOption];
}
+
+int WOptionBox::getSelectedIndex()
+{
+ return currentOption;
+}
void right();
void cycle();
void draw();
+ int getSelectedIndex();
private:
UCHAR active;