Skip to content

Commit

Permalink
Translation context changes and remove of concatenations.
Browse files Browse the repository at this point in the history
There are still a few strings that need fixing but I'll have to find
where these are displayed before changing them.
  • Loading branch information
Nicolas Riendeau committed Jul 6, 2012
1 parent 6c234ae commit 70f02af
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 43 deletions.
86 changes: 43 additions & 43 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -491,7 +491,7 @@ bool MythPlayer::InitVideo(void)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"Couldn't create VideoOutput instance. Exiting..");
SetErrored(QObject::tr("Failed to initialize video output"));
SetErrored(tr("Failed to initialize video output"));
return false;
}

Expand Down Expand Up @@ -570,7 +570,7 @@ void MythPlayer::ReinitVideo(void)
if (!videoOutput->IsPreferredRenderer(video_disp_dim))
{
LOG(VB_PLAYBACK, LOG_INFO, LOC + "Need to switch video renderer.");
SetErrored(QObject::tr("Need to switch video renderer."));
SetErrored(tr("Need to switch video renderer."));
errorType |= kError_Switch_Renderer;
return;
}
Expand All @@ -591,7 +591,7 @@ void MythPlayer::ReinitVideo(void)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"Failed to Reinitialize Video. Exiting..");
SetErrored(QObject::tr("Failed to reinitialize video output"));
SetErrored(tr("Failed to reinitialize video output"));
return;
}

Expand Down Expand Up @@ -1337,7 +1337,7 @@ void MythPlayer::DisableCaptions(uint mode, bool osd_msg)

QString msg = "";
if (kDisplayNUVTeletextCaptions & mode)
msg += QObject::tr("TXT CAP");
msg += tr("TXT CAP");
if (kDisplayTeletextCaptions & mode)
{
msg += decoder->GetTrackDesc(kTrackTypeTeletextCaptions,
Expand All @@ -1357,13 +1357,13 @@ void MythPlayer::DisableCaptions(uint mode, bool osd_msg)
}
if (kDisplayTextSubtitle & mode)
{
msg += QObject::tr("Text subtitles");
msg += tr("Text subtitles");
if (osd)
osd->EnableSubtitles(preserve);
}
if (!msg.isEmpty() && osd_msg)
{
msg += " " + QObject::tr("Off");
msg += " " + tr("Off");
SetOSDMessage(msg, kOSDTimeout_Med);
}
}
Expand All @@ -1384,10 +1384,10 @@ void MythPlayer::EnableCaptions(uint mode, bool osd_msg)
{
if (osd)
osd->EnableSubtitles(kDisplayTextSubtitle);
msg += QObject::tr("Text subtitles");
msg += tr("Text subtitles");
}
if (kDisplayNUVTeletextCaptions & mode)
msg += QObject::tr("TXT") + QString(" %1").arg(ttPageNum, 3, 16);
msg += QString(tr("TXT %1")).arg(ttPageNum, 3, 16);
if (kDisplayTeletextCaptions & mode)
{
msg += decoder->GetTrackDesc(kTrackTypeTeletextCaptions,
Expand All @@ -1401,7 +1401,7 @@ void MythPlayer::EnableCaptions(uint mode, bool osd_msg)
textDisplayMode = kDisplayTeletextCaptions;
}

msg += " " + QObject::tr("On");
msg += " " + tr("On");

LOG(VB_PLAYBACK, LOG_INFO, QString("EnableCaptions(%1) msg: %2")
.arg(mode).arg(msg));
Expand Down Expand Up @@ -1457,9 +1457,8 @@ void MythPlayer::SetCaptionsEnabled(bool enable, bool osd_msg)
{
if (osd_msg)
{
SetOSDMessage(QObject::tr(
"No captions",
"CC/Teletext/Subtitle text not available"),
SetOSDMessage(tr("No captions",
"CC/Teletext/Subtitle text not available"),
kOSDTimeout_Med);
}
LOG(VB_PLAYBACK, LOG_INFO,
Expand Down Expand Up @@ -1568,8 +1567,8 @@ void MythPlayer::SetAllowForcedSubtitles(bool allow)
bool old = allowForcedSubtitles;
allowForcedSubtitles = allow;
SetOSDMessage(allowForcedSubtitles ?
QObject::tr("Forced Subtitles On") :
QObject::tr("Forced Subtitles Off"),
tr("Forced Subtitles On") :
tr("Forced Subtitles Off"),
kOSDTimeout_Med);
if (old != allowForcedSubtitles)
{
Expand Down Expand Up @@ -1791,7 +1790,7 @@ void MythPlayer::AVSync(VideoFrame *buffer, bool limit_delay)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"AVSync: Unknown error in videoOutput, aborting playback.");
SetErrored(QObject::tr("Failed to initialize A/V Sync"));
SetErrored(tr("Failed to initialize A/V Sync"));
return;
}

Expand Down Expand Up @@ -1870,7 +1869,7 @@ void MythPlayer::AVSync(VideoFrame *buffer, bool limit_delay)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Error condition detected "
"in videoOutput after Show(), aborting playback.");
SetErrored(QObject::tr("Serious error detected in Video Output"));
SetErrored(tr("Serious error detected in Video Output"));
return;
}

Expand Down Expand Up @@ -2034,7 +2033,7 @@ void MythPlayer::DisplayPauseFrame(void)

if (videoOutput->IsErrored())
{
SetErrored(QObject::tr("Serious error detected in Video Output"));
SetErrored(tr("Serious error detected in Video Output"));
return;
}

Expand Down Expand Up @@ -2110,8 +2109,7 @@ bool MythPlayer::PrebufferEnoughFrames(int min_buffers)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"Waited too long for decoder to fill video buffers. Exiting..");
SetErrored(QObject::tr("Video frame buffering failed too many "
"times."));
SetErrored(tr("Video frame buffering failed too many times."));
}
if (normal_speed)
videosync->Start();
Expand Down Expand Up @@ -2467,7 +2465,7 @@ void MythPlayer::SwitchToProgram(void)
.arg(player_ctx->tvchain->GetCardType(newid)));
LOG(VB_GENERAL, LOG_ERR, player_ctx->tvchain->toString());
SetEof(true);
SetErrored(QObject::tr("Error opening switch program buffer"));
SetErrored(tr("Error opening switch program buffer"));
delete pginfo;
return;
}
Expand All @@ -2492,7 +2490,7 @@ void MythPlayer::SwitchToProgram(void)
if (newtype)
{
if (OpenFile() < 0)
SetErrored(QObject::tr("Error opening switch program file"));
SetErrored(tr("Error opening switch program file"));
}
else
ResetPlaying();
Expand Down Expand Up @@ -2601,7 +2599,7 @@ void MythPlayer::JumpToProgram(void)
.arg(player_ctx->tvchain->GetCardType(newid)));
LOG(VB_GENERAL, LOG_ERR, player_ctx->tvchain->toString());
SetEof(true);
SetErrored(QObject::tr("Error opening jump program file buffer"));
SetErrored(tr("Error opening jump program file buffer"));
delete pginfo;
inJumpToProgramPause = false;
return;
Expand All @@ -2611,7 +2609,7 @@ void MythPlayer::JumpToProgram(void)
if (newtype || wasDummy)
{
if (OpenFile() < 0)
SetErrored(QObject::tr("Error opening jump program file"));
SetErrored(tr("Error opening jump program file"));
}
else
ResetPlaying();
Expand All @@ -2620,7 +2618,7 @@ void MythPlayer::JumpToProgram(void)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "JumpToProgram failed.");
if (!IsErrored())
SetErrored(QObject::tr("Error reopening video decoder"));
SetErrored(tr("Error reopening video decoder"));
delete pginfo;
inJumpToProgramPause = false;
return;
Expand Down Expand Up @@ -2812,7 +2810,7 @@ void MythPlayer::EventLoop(void)
LOG(VB_GENERAL, LOG_ERR, LOC +
"Unknown recorder error, exiting decoder");
if (!IsErrored())
SetErrored(QObject::tr("Irrecoverable recorder error"));
SetErrored(tr("Irrecoverable recorder error"));
killdecoder = true;
return;
}
Expand Down Expand Up @@ -2874,7 +2872,8 @@ void MythPlayer::EventLoop(void)
{
if (!commBreakMap.HasMap())
{
SetOSDStatus(QObject::tr("Not Flagged"), kOSDTimeout_Med);
//: The commercials/adverts have not been flagged
SetOSDStatus(tr("Not Flagged"), kOSDTimeout_Med);
QString message = "COMMFLAG_REQUEST ";
player_ctx->LockPlayingInfo(__FILE__, __LINE__);
message += player_ctx->playingInfo->GetChanID() + " " +
Expand Down Expand Up @@ -3693,7 +3692,7 @@ void MythPlayer::WaitForSeek(uint64_t frame, uint64_t seeksnap_wanted)
if (!(count % 150) && !hasFullPositionMap)
{
int num = (count / 150) % 4;
SetOSDMessage(QObject::tr("Searching") + QString().fill('.', num),
SetOSDMessage(tr("Searching") + QString().fill('.', num),
kOSDTimeout_Short);
DisplayPauseFrame();
need_clear = true;
Expand Down Expand Up @@ -3760,7 +3759,7 @@ bool MythPlayer::EnableEdit(void)
if (!hasFullPositionMap)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot edit - no full position map");
SetOSDStatus(QObject::tr("No Seektable"), kOSDTimeout_Med);
SetOSDStatus(tr("No Seektable"), kOSDTimeout_Med);
return false;
}

Expand All @@ -3781,7 +3780,7 @@ bool MythPlayer::EnableEdit(void)
bool loadedAutoSave = deleteMap.LoadAutoSaveMap(totalFrames);
if (loadedAutoSave)
{
SetOSDMessage(QObject::tr("Using previously auto-saved cuts"),
SetOSDMessage(tr("Using previously auto-saved cuts"),
kOSDTimeout_Short);
}

Expand Down Expand Up @@ -3825,7 +3824,7 @@ void MythPlayer::DisableEdit(int howToSave)
if (!pausedBeforeEdit)
Play(speedBeforeEdit);
else
SetOSDStatus(QObject::tr("Paused"), kOSDTimeout_None);
SetOSDStatus(tr("Paused"), kOSDTimeout_None);
}

bool MythPlayer::HandleProgramEditorActions(QStringList &actions,
Expand Down Expand Up @@ -3909,18 +3908,17 @@ bool MythPlayer::HandleProgramEditorActions(QStringList &actions,
else if (action == ACTION_SELECT)
{
deleteMap.NewCut(frame, totalFrames);
SetOSDMessage(QObject::tr("New cut added."), kOSDTimeout_Short);
SetOSDMessage(tr("New cut added."), kOSDTimeout_Short);
refresh = true;
}
else if (action == "DELETE")
{
deleteMap.Delete(frame, totalFrames,
QObject::tr("Delete"));
deleteMap.Delete(frame, totalFrames, tr("Delete"));
refresh = true;
}
else if (action == "REVERT")
{
deleteMap.LoadMap(totalFrames, QObject::tr("Undo Changes"));
deleteMap.LoadMap(totalFrames, tr("Undo Changes"));
refresh = true;
}
else if (action == "REVERTEXIT")
Expand All @@ -3947,16 +3945,18 @@ bool MythPlayer::HandleProgramEditorActions(QStringList &actions,
if (handled && (action == "CUTTOBEGINNING" ||
action == "CUTTOEND" || action == "NEWCUT"))
{
SetOSDMessage(QObject::tr("New cut added."), kOSDTimeout_Short);
SetOSDMessage(tr("New cut added."), kOSDTimeout_Short);
}
else if (handled && action == "UNDO")
{
SetOSDMessage(QObject::tr("Undo") + " - " + undoMessage,
//: %1 is the undo message
SetOSDMessage(QString(tr("Undo - %1")).arg(undoMessage),
kOSDTimeout_Short);
}
else if (handled && action == "REDO")
{
SetOSDMessage(QObject::tr("Redo") + " - " + redoMessage,
//: %1 is the redo message
SetOSDMessage(QString(tr("Redo - %1")).arg(redoMessage),
kOSDTimeout_Short);
}
}
Expand Down Expand Up @@ -4715,11 +4715,11 @@ void MythPlayer::calcSliderPos(osdInfo &info, bool paddedFields)
}
else
{
text3 = QObject::tr("%n second(s)", "", sbsecs);
text3 = tr("%n second(s)", "", sbsecs);
}
}

info.text[relPrefix + "description"] = QObject::tr("%1 of %2").arg(text1).arg(text2);
info.text[relPrefix + "description"] = tr("%1 of %2").arg(text1).arg(text2);
info.text[relPrefix + "playedtime"] = text1;
info.text[relPrefix + "totaltime"] = text2;
info.text[relPrefix + "remainingtime"] = islive ? QString() : text3;
Expand Down Expand Up @@ -4954,8 +4954,8 @@ void MythPlayer::ToggleStudioLevels(void)
int val = videoOutput->GetPictureAttribute(kPictureAttribute_StudioLevels);
val = (val > 0) ? 0 : 1;
videoOutput->SetPictureAttribute(kPictureAttribute_StudioLevels, val);
QString msg = (val > 0) ? QObject::tr("Enabled Studio Levels") :
QObject::tr("Disabled Studio Levels");
QString msg = (val > 0) ? tr("Enabled Studio Levels") :
tr("Disabled Studio Levels");
SetOSDMessage(msg, kOSDTimeout_Med);
}

Expand All @@ -4979,13 +4979,13 @@ void MythPlayer::ToggleNightMode(void)
QString msg;
if (!nm)
{
msg = QObject::tr("Enabled Night Mode");
msg = tr("Enabled Night Mode");
b -= kNightModeBrightenssAdjustment;
c -= kNightModeContrastAdjustment;
}
else
{
msg = QObject::tr("Disabled Night Mode");
msg = tr("Disabled Night Mode");
b += kNightModeBrightenssAdjustment;
c += kNightModeContrastAdjustment;
}
Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libmythtv/mythplayer.h
Expand Up @@ -114,6 +114,8 @@ class DecoderThread : public MThread

class MTV_PUBLIC MythPlayer
{
Q_DECLARE_TR_FUNCTIONS(MythPlayer)

// Do NOT add a decoder class to this list
friend class PlayerContext;
friend class CC708Reader;
Expand Down

0 comments on commit 70f02af

Please sign in to comment.