Permalink
Browse files

MythGame miscellaneous translations files (context, etc...)

  • Loading branch information...
1 parent c887dad commit 55b46eb255e595344ecec9b5ce7c0993c3b09ee0 @nriendeau nriendeau committed Jul 15, 2012
View
72 mythplugins/mythgame/mythgame/gamehandler.cpp
@@ -3,7 +3,6 @@
#include "rominfo.h"
#include "rom_metadata.h"
-#include <QObject>
#include <QRegExp>
#include <QDir>
#include <QList>
@@ -149,13 +148,13 @@ void GameHandler::GetMetadata(GameHandler *handler, QString rom, QString* Genre,
#endif
// Set our default values
- *Year = QObject::tr("19xx");
- *Country = QObject::tr("Unknown");
- *GameName = QObject::tr("Unknown");
- *Genre = QObject::tr("Unknown");
- *Plot = QObject::tr("Unknown");
- *Publisher = QObject::tr("Unknown");
- *Version = QObject::tr("0");
+ *Year = tr("19xx", "Default game year");
+ *Country = tr("Unknown", "Unknown country");
+ *GameName = tr("Unknown", "Unknown game name");
+ *Genre = tr("Unknown", "Unknown genre");
+ *Plot = tr("Unknown", "Unknown plot");
+ *Publisher = tr("Unknown", "Unknown publisher");
+ *Version = tr("0", "Default game version");
(*Fanart).clear();
(*Boxart).clear();
@@ -180,8 +179,9 @@ void GameHandler::GetMetadata(GameHandler *handler, QString rom, QString* Genre,
};
- if ((*Genre == "Unknown") || (*Genre).isEmpty())
- *Genre = QString("Unknown%1").arg( handler->GameType() );
+ if ((*Genre == tr("Unknown", "Unknown genre")) || (*Genre).isEmpty())
+ *Genre = tr("Unknown %1", "Unknown genre")
+ .arg( handler->GameType() );
}
@@ -220,8 +220,10 @@ void GameHandler::promptForRemoval(GameScan scan)
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *removalPopup = new MythDialogBox(
- tr("%1 appears to be missing.\nRemove it from the database?")
- .arg(filename), popupStack, "chooseSystemPopup");
+ //: %1 is the file name
+ tr("%1 appears to be missing.\n"
+ "Remove it from the database?")
+ .arg(filename), popupStack, "chooseSystemPopup");
if (removalPopup->Create())
{
@@ -376,9 +378,10 @@ void GameHandler::UpdateGameDB(GameHandler *handler)
int counter = 0;
MSqlQuery query(MSqlQuery::InitCon());
- QString message = QObject::tr("Updating %1(%2) ROM database")
- .arg(handler->SystemName())
- .arg(handler->GameType());
+ //: %1 is the system name, %2 is the game type
+ QString message = tr("Updating %1 (%2) ROM database")
+ .arg(handler->SystemName())
+ .arg(handler->GameType());
CreateProgress(message);
@@ -407,19 +410,21 @@ void GameHandler::UpdateGameDB(GameHandler *handler)
}
else
{
- Genre = QObject::tr("Unknown") + handler->GameType();
- Country = QObject::tr("Unknown");
+ /*: %1 is the game type, when we don't know the genre we use the
+ * game type */
+ Genre = tr("Unknown %1", "Unknown genre").arg(handler->GameType());
+ Country = tr("Unknown", "Unknown country");
CRC32.clear();
- Year = QObject::tr("19xx");
- GameName = QObject::tr("Unknown");
- Plot = QObject::tr("Unknown");
- Publisher = QObject::tr("Unknown");
- Version = QObject::tr("0");
+ Year = tr("19xx", "Default game year");
+ GameName = tr("Unknown", "Unknown game name");
+ Plot = tr("Unknown", "Unknown plot");
+ Publisher = tr("Unknown", "Unknown publisher");
+ Version = tr("0", "Default game version");
Fanart.clear();
Boxart.clear();
}
- if (GameName == QObject::tr("Unknown"))
+ if (GameName == tr("Unknown", "Unknown game name"))
GameName = iter.value().GameName();
int suffixPos = iter.value().Rom().lastIndexOf(QChar('.'));
@@ -505,8 +510,8 @@ void GameHandler::VerifyGameDB(GameHandler *handler)
MythDB::DBError("GameHandler::VerifyGameDB - "
"select", query);
- QString message = QObject::tr("Verifying %1 files...")
- .arg(handler->SystemName());
+ //: %1 is the system name
+ QString message = tr("Verifying %1 files...").arg(handler->SystemName());
CreateProgress(message);
@@ -603,9 +608,9 @@ int GameHandler::buildFileCount(QString directory, GameHandler *handler)
void GameHandler::clearAllGameData(void)
{
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
- MythDialogBox *clearPopup = new MythDialogBox(tr("This will clear all game metadata "
- "from the database. Are you sure you "
- "want to do this?"), popupStack, "clearAllPopup");
+ MythDialogBox *clearPopup = new MythDialogBox(
+ tr("This will clear all game metadata from the database. Are you sure "
+ "you want to do this?"), popupStack, "clearAllPopup");
if (clearPopup->Create())
{
@@ -623,7 +628,7 @@ void GameHandler::buildFileList(QString directory, GameHandler *handler,
{
QDir RomDir(directory);
- // If we can't read it's contents move on
+ // If we can't read its contents move on
if (!RomDir.isReadable())
return;
@@ -708,8 +713,9 @@ void GameHandler::processGames(GameHandler *handler)
{
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
- QString message = QObject::tr("Scanning for %1 games...")
- .arg(handler->SystemName());
+ //: %1 is the system name
+ QString message = tr("Scanning for %1 games...")
+ .arg(handler->SystemName());
MythUIBusyDialog *busyDialog = new MythUIBusyDialog(message, popupStack,
"gamescanbusy");
@@ -736,8 +742,8 @@ void GameHandler::processGames(GameHandler *handler)
}
else
{
- QString message = QObject::tr("Scanning for %1 games...")
- .arg(handler->SystemName());
+ QString message = tr("Scanning for %1 games...")
+ .arg(handler->SystemName());
CreateProgress(message);
if (m_progressDlg)
View
131 mythplugins/mythgame/mythgame/gamesettings.cpp
@@ -39,98 +39,119 @@ const QString GetGameTypeExtensions(const QString GameType)
static HostLineEdit *GameAllTreeLevels()
{
HostLineEdit *gc = new HostLineEdit("GameAllTreeLevels");
- gc->setLabel(QObject::tr("Game display order"));
+ gc->setLabel(MythGameGeneralSettings::tr("Game display order"));
gc->setValue("system gamename");
- gc->setHelpText(QObject::tr("Order in which to sort the games "
- "- this is for all systems. Available choices: "
- "system, year, genre and gamename"));
+ gc->setHelpText(MythGameGeneralSettings::tr("Order in which to sort the "
+ "games - this is for all "
+ "systems. Available choices: "
+ "system, year, genre and "
+ "gamename"));
return gc;
}
static HostLineEdit *GameFavTreeLevels()
{
HostLineEdit *gc = new HostLineEdit("GameFavTreeLevels");
- gc->setLabel(QObject::tr("Favorite display order"));
+ gc->setLabel(MythGameGeneralSettings::tr("Favorite display order"));
gc->setValue("gamename");
- gc->setHelpText(QObject::tr("Order in which to sort the games "
- "marked as favorites "
- "- this is for all systems. Available choices: "
- "system, year, genre and gamename"));
+ gc->setHelpText(MythGameGeneralSettings::tr("Order in which to sort the "
+ "games marked as favorites "
+ "- this is for all systems. "
+ "Available choices: system, "
+ "year, genre and gamename"));
return gc;
}
static HostCheckBox *GameDeepScan()
{
HostCheckBox *gc = new HostCheckBox("GameDeepScan");
- gc->setLabel(QObject::tr("Indepth Game Scan"));
- gc->setHelpText(QObject::tr("Enabling this causes a game scan to gather CRC values and attempt to find out more"
- " detailed information about the game: NOTE this can greatly increase the time a game scan takes"
- " based on the amount of games scanned."));
+ gc->setLabel(MythGameGeneralSettings::tr("Indepth Game Scan"));
+ gc->setHelpText(
+ MythGameGeneralSettings::tr("Enabling this causes a game scan to "
+ "gather CRC values and attempt to find out "
+ "more detailed information about the game: "
+ "NOTE this can greatly increase the time a "
+ "game scan takes based on the amount of "
+ "games scanned."));
return gc;
}
static HostCheckBox *GameRemovalPrompt()
{
HostCheckBox *gc = new HostCheckBox("GameRemovalPrompt");
- gc->setLabel(QObject::tr("Prompt for removal of deleted ROM(s)"));
- gc->setHelpText(QObject::tr("This enables a prompt for removing"
- " deleted ROMs from the database during a "
- " game scan"));
+ gc->setLabel(MythGameGeneralSettings::tr("Prompt for removal of deleted ROM(s)"));
+ gc->setHelpText(MythGameGeneralSettings::tr("This enables a prompt for "
+ "removing deleted ROMs from "
+ "the database during a game "
+ "scan"));
return gc;
}
static HostCheckBox *GameShowFileNames()
{
HostCheckBox *gc = new HostCheckBox("GameShowFileNames");
- gc->setLabel(QObject::tr("Display Files Names in Game Tree"));
- gc->setHelpText(QObject::tr("Enabling this causes the filenames to be displayed in the game tree rather than the trimmed/looked up game name"));
+ gc->setLabel(MythGameGeneralSettings::tr("Display Files Names in Game "
+ "Tree"));
+ gc->setHelpText(MythGameGeneralSettings::tr("Enabling this causes the "
+ "filenames to be displayed in "
+ "the game tree rather than the "
+ "trimmed/looked up game name"));
return gc;
}
static HostCheckBox *GameTreeView()
{
HostCheckBox *gc = new HostCheckBox("GameTreeView");
- gc->setLabel(QObject::tr("Hash filenames in display"));
+ gc->setLabel(MythGameGeneralSettings::tr("Hash filenames in display"));
gc->setValue(0);
- gc->setHelpText(QObject::tr("Enable hashing of names in the display tree. This can make navigating long lists a little faster"));
+ gc->setHelpText(MythGameGeneralSettings::tr("Enable hashing of names in "
+ "the display tree. This can "
+ "make navigating long lists "
+ "a little faster"));
return gc;
}
static HostLineEdit *GetScreenshotDir()
{
HostLineEdit *gc = new HostLineEdit("mythgame.screenshotdir");
- gc->setLabel(QObject::tr("Directory where Game Screenshots are stored"));
+ gc->setLabel(MythGameGeneralSettings::tr("Directory where Game Screenshots "
+ "are stored"));
gc->setValue(GetConfDir() + "/MythGame/Screenshots");
- gc->setHelpText(QObject::tr("This directory will be the default browse "
- "location when assigning screenshots."));
+ gc->setHelpText(MythGameGeneralSettings::tr("This directory will be the "
+ "default browse location when "
+ "assigning screenshots."));
return gc;
}
static HostLineEdit *GetFanartDir()
{
HostLineEdit *gc = new HostLineEdit("mythgame.fanartdir");
- gc->setLabel(QObject::tr("Directory where Game Fanart is stored"));
+ gc->setLabel(MythGameGeneralSettings::tr("Directory where Game Fanart is "
+ "stored"));
gc->setValue(GetConfDir() + "/MythGame/Fanart");
- gc->setHelpText(QObject::tr("This directory will be the default browse "
- "location when assigning fanart."));
+ gc->setHelpText(MythGameGeneralSettings::tr("This directory will be the "
+ "default browse location when "
+ "assigning fanart."));
return gc;
}
static HostLineEdit *GetBoxartDir()
{
HostLineEdit *gc = new HostLineEdit("mythgame.boxartdir");
- gc->setLabel(QObject::tr("Directory where Game Boxart is stored"));
+ gc->setLabel(MythGameGeneralSettings::tr("Directory where Game Boxart is "
+ "stored"));
gc->setValue(GetConfDir() + "/MythGame/Boxart");
- gc->setHelpText(QObject::tr("This directory will be the default browse "
- "location when assigning boxart."));
+ gc->setHelpText(MythGameGeneralSettings::tr("This directory will be the "
+ "default browse location when "
+ "assigning boxart."));
return gc;
}
MythGameGeneralSettings::MythGameGeneralSettings()
{
VerticalConfigurationGroup *general = new VerticalConfigurationGroup(false);
- general->setLabel(QObject::tr("MythGame Settings -- General"));
+ general->setLabel(tr("MythGame Settings -- General"));
general->addChild(GameAllTreeLevels());
general->addChild(GameFavTreeLevels());
general->addChild(GameDeepScan());
@@ -174,8 +195,12 @@ class AllowMultipleRoms : public CheckBoxSetting, public GameDBStorage
AllowMultipleRoms(const MythGamePlayerSettings &parent) :
CheckBoxSetting(this), GameDBStorage(this, parent, "spandisks")
{
- setLabel(QObject::tr("Allow games to span multiple ROMs/disks"));
- setHelpText(QObject::tr("This setting means that we will look for items like game.1.rom, game.2.rom and consider them a single game."));
+ setLabel(MythGamePlayerSettings::tr("Allow games to span multiple "
+ "ROMs/disks"));
+ setHelpText(MythGamePlayerSettings::tr("This setting means that we "
+ "will look for items like "
+ "game.1.rom, game.2.rom and "
+ "consider them a single game."));
};
};
@@ -185,8 +210,14 @@ class Command : public LineEditSetting, public GameDBStorage
Command(const MythGamePlayerSettings &parent) :
LineEditSetting(this), GameDBStorage(this, parent, "commandline")
{
- setLabel(QObject::tr("Command"));
- setHelpText(QObject::tr("Binary and optional parameters. Multiple commands separated with \';\' . Use \%s for the ROM name. \%d1, \%d2, \%d3 and \%d4 represent disks in a multidisk/game. %s auto appended if not specified"));
+ setLabel(MythGamePlayerSettings::tr("Command"));
+ setHelpText(
+ MythGamePlayerSettings::tr("Binary and optional parameters. "
+ "Multiple commands separated with "
+ "\';\' . Use \%s for the ROM name. "
+ "\%d1, \%d2, \%d3 and \%d4 represent "
+ "disks in a multidisk/game. %s auto "
+ "appended if not specified"));
};
};
@@ -196,15 +227,19 @@ class GameType : public ComboBoxSetting, public GameDBStorage
GameType(const MythGamePlayerSettings &parent) :
ComboBoxSetting(this), GameDBStorage(this, parent, "gametype")
{
- setLabel(QObject::tr("Type"));
+ //: Game type
+ setLabel(MythGamePlayerSettings::tr("Type"));
for (int i = 0; i < MAX_GAME_TYPES; i++)
{
addSelection(QCoreApplication::translate("(GameTypes)",
GameTypeList[i].nameStr.toUtf8()),
GameTypeList[i].idStr);
}
setValue(0);
- setHelpText(QObject::tr("Type of Game/Emulator. Mostly for informational purposes and has little effect on the function of your system."));
+ setHelpText(MythGamePlayerSettings::tr("Type of Game/Emulator. Mostly "
+ "for informational purposes and "
+ "has little effect on the "
+ "function of your system."));
};
};
@@ -214,8 +249,9 @@ class RomPath : public LineEditSetting, public GameDBStorage
RomPath(const MythGamePlayerSettings &parent) :
LineEditSetting(this), GameDBStorage(this, parent, "rompath")
{
- setLabel(QObject::tr("ROM Path"));
- setHelpText(QObject::tr("Location of the ROM files for this emulator"));
+ setLabel(MythGamePlayerSettings::tr("ROM Path"));
+ setHelpText(MythGamePlayerSettings::tr("Location of the ROM files for "
+ "this emulator"));
};
};
@@ -225,8 +261,10 @@ class WorkingDirPath : public LineEditSetting, public GameDBStorage
WorkingDirPath(const MythGamePlayerSettings &parent) :
LineEditSetting(this), GameDBStorage(this, parent, "workingpath")
{
- setLabel(QObject::tr("Working Directory"));
- setHelpText(QObject::tr("Directory to change to before launching emulator. Blank is usually fine"));
+ setLabel(MythGamePlayerSettings::tr("Working Directory"));
+ setHelpText(MythGamePlayerSettings::tr("Directory to change to before "
+ "launching emulator. Blank is "
+ "usually fine"));
};
};
@@ -236,8 +274,13 @@ class Extensions : public LineEditSetting, public GameDBStorage
Extensions(const MythGamePlayerSettings &parent) :
LineEditSetting(this), GameDBStorage(this, parent, "extensions")
{
- setLabel(QObject::tr("File Extensions"));
- setHelpText(QObject::tr("A comma separated list of all file extensions for this emulator. Blank means any file under ROM PATH is considered to be used with this emulator"));
+ setLabel(MythGamePlayerSettings::tr("File Extensions"));
+ setHelpText(MythGamePlayerSettings::tr("A comma separated list of all "
+ "file extensions for this "
+ "emulator. Blank means any file "
+ "under ROM PATH is considered "
+ "to be used with this "
+ "emulator"));
};
};
@@ -301,7 +344,7 @@ DialogCode MythGamePlayerEditor::exec(void)
void MythGamePlayerEditor::Load(void)
{
listbox->clearSelections();
- listbox->addSelection(QObject::tr("(New Game Player)"), "0");
+ listbox->addSelection(tr("(New Game Player)"), "0");
MythGamePlayerSettings::fillSelections(listbox);
}
View
10 mythplugins/mythgame/mythgame/gamesettings.h
@@ -1,8 +1,11 @@
#ifndef GAMESETTINGS_H
#define GAMESETTINGS_H
+// Qt headers
#include <QString>
+#include <QCoreApplication>
+// MythTV headers
#include <settings.h>
#include <mythcontext.h>
@@ -57,6 +60,8 @@ class GameDBStorage : public SimpleDBStorage
class MythGameGeneralSettings : public ConfigurationWizard
{
+ Q_DECLARE_TR_FUNCTIONS(MythGameGeneralSettings)
+
public:
MythGameGeneralSettings();
};
@@ -100,8 +105,9 @@ class MythGamePlayerSettings : public QObject, public ConfigurationWizard
Name(const MythGamePlayerSettings &parent) :
LineEditSetting(this), GameDBStorage(this, parent, "playername")
{
- setLabel(QObject::tr("Player Name"));
- setHelpText(QObject::tr("Name of this Game and or Emulator"));
+ setLabel(MythGamePlayerSettings::tr("Player Name"));
+ setHelpText(MythGamePlayerSettings::tr("Name of this Game and or "
+ "Emulator"));
}
};
View
2 mythplugins/mythgame/mythgame/gameui.cpp
@@ -267,6 +267,7 @@ void GameUI::itemClicked(MythUIButtonListItem*)
}
else
{
+ //: %1 is the game name
QString msg = QString(tr("Choose System for:\n%1"))
.arg(node->getString());
MythScreenStack *popupStack = GetMythMainWindow()->
@@ -919,6 +920,7 @@ void GameUI::gameSearch(MythGenericTree *node,
if (!automode)
{
+ //: %1 is the game name
QString msg = tr("Fetching details for %1")
.arg(metadata->Gamename());
createBusyDialog(msg);

0 comments on commit 55b46eb

Please sign in to comment.