Permalink
Browse files

Fix the translation of gametypes in MythGame's setting page.

This fix the translation of game types in the players setting page.

This uncovered other issues as well which will be fixed separely.
  • Loading branch information...
1 parent e9a7a13 commit 61163ba90178fcdec55bb6ab0a1c3992e3c199df @nriendeau nriendeau committed Jul 1, 2012
Showing with 17 additions and 15 deletions.
  1. +5 −1 mythplugins/mythgame/mythgame/gamesettings.cpp
  2. +12 −14 mythplugins/mythgame/mythgame/gamesettings.h
@@ -1,3 +1,5 @@
+#include <QCoreApplication>
+
#include <mythcontext.h>
#include <mythdb.h>
#include <mythdirs.h>
@@ -182,7 +184,9 @@ class GameType : public ComboBoxSetting, public GameDBStorage
setLabel(QObject::tr("Type"));
for (int i = 0; i < MAX_GAME_TYPES; i++)
{
- addSelection(GameTypeList[i].nameStr, GameTypeList[i].idStr);
+ 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."));
@@ -16,22 +16,20 @@ struct GameTypes {
#define MAX_GAME_TYPES 12
-// TODO FIXME Can't initialize translated values statically. They are only
-// translated if you get lucky with dynamic linking order.
const GameTypes GameTypeList[MAX_GAME_TYPES] =
{
- { QObject::tr("OTHER"), "OTHER", "" },
- { QObject::tr("AMIGA"), "AMIGA", "adf,ipf" },
- { QObject::tr("ATARI"), "ATARI", "bin,a26" },
- { QObject::tr("GAMEGEAR"), "GAMEGEAR", "gg" },
- { QObject::tr("GENESIS/MEGADRIVE"), "GENESIS", "smd,bin,md" },
- { QObject::tr("MAME"), "MAME", "" },
- { QObject::tr("N64"), "N64", "v64,n64" },
- { QObject::tr("NES"), "NES", "zip,nes" },
- { QObject::tr("PC GAME"), "PC", "" },
- { QObject::tr("PCE/TG16"),"PCE", "pce" },
- { QObject::tr("SEGA/MASTER SYSYTEM"), "SEGA", "sms" },
- { QObject::tr("SNES"), "SNES", "zip,smc,sfc,fig,swc" }
+ { QT_TRANSLATE_NOOP("(GameTypes)", "OTHER"), "OTHER", "" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "AMIGA"), "AMIGA", "adf,ipf" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "ATARI"), "ATARI", "bin,a26" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "GAMEGEAR"), "GAMEGEAR", "gg" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "GENESIS/MEGADRIVE"), "GENESIS", "smd,bin,md" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "MAME"), "MAME", "" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "N64"), "N64", "v64,n64" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "NES"), "NES", "zip,nes" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "PC GAME"), "PC", "" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "PCE/TG16"),"PCE", "pce" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "SEGA/MASTER SYSTEM"), "SEGA", "sms" },
+ { QT_TRANSLATE_NOOP("(GameTypes)", "SNES"), "SNES", "zip,smc,sfc,fig,swc" }
};
const QString GetGameExtensions(const QString GameType);

0 comments on commit 61163ba

Please sign in to comment.