Skip to content

Commit

Permalink
Miscellaneous translation fixes
Browse files Browse the repository at this point in the history
Remove the translation call from a logged error message (they are always supposed
to be in English)

Multiple translation context changes

Addition of disambiguation strings
  • Loading branch information
Nicolas Riendeau committed Jul 14, 2013
1 parent 5ff82e4 commit 8f30670
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions mythtv/programs/mythfrontend/main.cpp
Expand Up @@ -118,7 +118,8 @@ void handleSIGUSR2(void);
static bool gLoaded = false;
#endif

static const QString _Location = QObject::tr("MythFrontend");
static const QString _Location = qApp->translate("(Common)",
"MythFrontend");

namespace
{
Expand Down Expand Up @@ -165,9 +166,9 @@ namespace
else
{
LOG(VB_GENERAL, LOG_WARNING,
QObject::tr("Aggressive Parental Controls Warning: "
"invalid password. An attempt to enter a "
"MythVideo settings screen was prevented."));
"Aggressive Parental Controls Warning: "
"invalid password. An attempt to enter a "
"MythVideo settings screen was prevented.");
}

deleteLater();
Expand All @@ -179,6 +180,8 @@ namespace

class BookmarkDialog : MythScreenType
{
Q_DECLARE_TR_FUNCTIONS(BookmarkDialog)

public:
BookmarkDialog(ProgramInfo *pginfo, MythScreenStack *parent) :
MythScreenType(parent, "bookmarkdialog"),
Expand All @@ -188,9 +191,9 @@ namespace

bool Create()
{
QString msg = QObject::tr("DVD/Video contains a bookmark");
QString btn0msg = QObject::tr("Play from bookmark");
QString btn1msg = QObject::tr("Play from beginning");
QString msg = tr("DVD/Video contains a bookmark");
QString btn0msg = tr("Play from bookmark");
QString btn1msg = tr("Play from beginning");

MythDialogBox *popup = new MythDialogBox(msg, GetScreenStack(), "bookmarkdialog");
if (!popup->Create())
Expand Down Expand Up @@ -308,8 +311,9 @@ static void startAppearWiz(void)
bool reload = false;

if (isWindowed)
ShowOkPopup(QObject::tr("The ScreenSetupWizard cannot be used while "
"mythfrontend is operating in windowed mode."));
ShowOkPopup(qApp->translate("(MythFrontendMain)",
"The ScreenSetupWizard cannot be used while "
"mythfrontend is operating in windowed mode."));
else
{
MythSystemLegacy *wizard = new MythSystemLegacy(
Expand Down Expand Up @@ -577,9 +581,10 @@ static bool isLiveTVAvailable(void)
if (RemoteGetFreeRecorderCount() > 0)
return true;

QString msg = QObject::tr("All tuners are currently busy.");
QString msg = qApp->translate("(Common)", "All tuners are currently busy.");

if (TV::ConfiguredTunerCards() < 1)
msg = QObject::tr("There are no configured tuners.");
msg = qApp->translate("(Common)", "There are no configured tuners.");

ShowOkPopup(msg);
return false;
Expand Down Expand Up @@ -624,7 +629,8 @@ static void standbyScreen(void)

static void RunVideoScreen(VideoDialog::DialogType type, bool fromJump = false)
{
QString message = QObject::tr("Loading videos ...");
QString message = qApp->translate("(MythFrontendMain)",
"Loading videos ...");

MythScreenStack *popupStack =
GetMythMainWindow()->GetStack("popup stack");
Expand Down Expand Up @@ -1109,10 +1115,12 @@ static int internal_play_media(const QString &mrl, const QString &plot,
&& !mrl.startsWith("myth:")
&& !mrl.startsWith("http://")))
{
QString errorText = QObject::tr("Failed to open \n '%1' in %2 \n"
"Check if the video exists")
.arg(mrl.section('/', -1))
.arg(mrl.section('/', 0, -2));
QString errorText = qApp->translate("(MythFrontendMain)",
"Failed to open \n '%1' in %2 \n"
"Check if the video exists")
.arg(mrl.section('/', -1))
.arg(mrl.section('/', 0, -2));

ShowOkPopup(errorText);
return res;
}
Expand Down Expand Up @@ -1141,8 +1149,10 @@ static int internal_play_media(const QString &mrl, const QString &plot,
}
else
{
ShowNotificationError(QObject::tr("DVD Failure"),
_Location, dvd->GetLastError());
ShowNotificationError(qApp->translate("(MythFrontendMain)",
"DVD Failure"),
_Location,
dvd->GetLastError());
delete dvd;
delete pginfo;
return res;
Expand Down Expand Up @@ -1614,7 +1624,9 @@ int main(int argc, char **argv)
#else
mainWindow->Init();
#endif
mainWindow->setWindowTitle(QObject::tr("MythTV Frontend"));
mainWindow->setWindowTitle(qApp->translate("(MythFrontendMain)",
"MythTV Frontend",
"Main window title"));

#ifdef USING_AIRPLAY
if (gCoreContext->GetNumSetting("AirPlayEnabled", true))
Expand Down

0 comments on commit 8f30670

Please sign in to comment.