From 70f02af9fe11bacc3465736ccd00b56a9865f49d Mon Sep 17 00:00:00 2001 From: Nicolas Riendeau Date: Fri, 6 Jul 2012 17:13:08 -0400 Subject: [PATCH] Translation context changes and remove of concatenations. There are still a few strings that need fixing but I'll have to find where these are displayed before changing them. --- mythtv/libs/libmythtv/mythplayer.cpp | 86 ++++++++++++++-------------- mythtv/libs/libmythtv/mythplayer.h | 2 + 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp index b7ddf84abc4..ee25fc6bf2a 100644 --- a/mythtv/libs/libmythtv/mythplayer.cpp +++ b/mythtv/libs/libmythtv/mythplayer.cpp @@ -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; } @@ -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; } @@ -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; } @@ -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, @@ -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); } } @@ -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, @@ -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)); @@ -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, @@ -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) { @@ -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; } @@ -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; } @@ -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; } @@ -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(); @@ -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; } @@ -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(); @@ -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; @@ -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(); @@ -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; @@ -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; } @@ -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() + " " + @@ -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; @@ -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; } @@ -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); } @@ -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, @@ -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") @@ -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); } } @@ -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; @@ -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); } @@ -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; } diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h index f8d050f8ede..5d86d7a0071 100644 --- a/mythtv/libs/libmythtv/mythplayer.h +++ b/mythtv/libs/libmythtv/mythplayer.h @@ -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;