Skip to content

Commit

Permalink
Make translatable strings extractable and change context.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Riendeau committed Jul 23, 2013
1 parent 5a3b6cc commit f822630
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions mythtv/i18n/translate.pro
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ SOURCES += ../libs/libmythtv/*.cpp
SOURCES += ../libs/libmythtv/*.h SOURCES += ../libs/libmythtv/*.h
SOURCES += ../libs/libmythtv/AirPlay/*.cpp SOURCES += ../libs/libmythtv/AirPlay/*.cpp
SOURCES += ../libs/libmythtv/AirPlay/*.h SOURCES += ../libs/libmythtv/AirPlay/*.h
SOURCES += ../libs/libmythtv/Bluray/*.cpp
SOURCES += ../libs/libmythtv/Bluray/*.h
SOURCES += ../libs/libmythtv/channelscan/*.cpp SOURCES += ../libs/libmythtv/channelscan/*.cpp
SOURCES += ../libs/libmythtv/channelscan/*.h SOURCES += ../libs/libmythtv/channelscan/*.h
SOURCES += ../libs/libmythtv/DVD/*.cpp SOURCES += ../libs/libmythtv/DVD/*.cpp
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/Bluray/bdringbuffer.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void BDRingBuffer::GetDescForPos(QString &desc)
{ {
if (!m_infoLock.tryLock()) if (!m_infoLock.tryLock())
return; return;
desc = QObject::tr("Title %1 chapter %2") desc = tr("Title %1 chapter %2")
.arg(m_currentTitleInfo->idx) .arg(m_currentTitleInfo->idx)
.arg(m_currentTitleInfo->chapters->idx); .arg(m_currentTitleInfo->chapters->idx);
m_infoLock.unlock(); m_infoLock.unlock();
Expand Down Expand Up @@ -312,7 +312,7 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)


if (!bdnav) if (!bdnav)
{ {
lastError = QObject::tr("Couldn't open Blu-ray device: %1").arg(filename); lastError = tr("Couldn't open Blu-ray device: %1").arg(filename);
rwlock.unlock(); rwlock.unlock();
mythfile_open_register_callback(filename.toLocal8Bit().data(), this, NULL); mythfile_open_register_callback(filename.toLocal8Bit().data(), this, NULL);
return false; return false;
Expand Down Expand Up @@ -381,7 +381,7 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
// no title, no point trying any longer // no title, no point trying any longer
bd_close(bdnav); bd_close(bdnav);
bdnav = NULL; bdnav = NULL;
lastError = QObject::tr("Can't find any Bluray-compatible title"); lastError = tr("Can't find any Bluray-compatible title");
rwlock.unlock(); rwlock.unlock();
mythfile_open_register_callback(filename.toLocal8Bit().data(), this, NULL); mythfile_open_register_callback(filename.toLocal8Bit().data(), this, NULL);
return false; return false;
Expand Down Expand Up @@ -481,7 +481,7 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
// no title, no point trying any longer // no title, no point trying any longer
bd_close(bdnav); bd_close(bdnav);
bdnav = NULL; bdnav = NULL;
lastError = QObject::tr("Can't find any usable Bluray title"); lastError = tr("Can't find any usable Bluray title");
rwlock.unlock(); rwlock.unlock();
mythfile_open_register_callback(filename.toLocal8Bit().data(), this, NULL); mythfile_open_register_callback(filename.toLocal8Bit().data(), this, NULL);
return false; return false;
Expand Down
4 changes: 4 additions & 0 deletions mythtv/libs/libmythtv/Bluray/bdringbuffer.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@


#define BD_BLOCK_SIZE 6144LL #define BD_BLOCK_SIZE 6144LL


//Qt headers
#include <QString> #include <QString>
#include <QRect> #include <QRect>
#include <QHash> #include <QHash>
#include <QCoreApplication>


// external/libmythbluray // external/libmythbluray
#include "bluray.h" #include "bluray.h"
Expand Down Expand Up @@ -49,6 +51,8 @@ class BDOverlay


class MTV_PUBLIC BDRingBuffer : public RingBuffer class MTV_PUBLIC BDRingBuffer : public RingBuffer
{ {
Q_DECLARE_TR_FUNCTIONS(BDRingBuffer)

public: public:
BDRingBuffer(const QString &lfilename); BDRingBuffer(const QString &lfilename);
virtual ~BDRingBuffer(); virtual ~BDRingBuffer();
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/Bluray/mythbdplayer.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ QString MythBDPlayer::GetAngleName(int angle) const
{ {
if (angle >= 1 && angle <= GetNumAngles()) if (angle >= 1 && angle <= GetNumAngles())
{ {
QString name = QObject::tr("Angle %1").arg(angle); QString name = tr("Angle %1").arg(angle);
return name; return name;
} }
return QString(); return QString();
Expand All @@ -274,7 +274,7 @@ bool MythBDPlayer::SwitchTitle(int title)
ResetCaptions(); ResetCaptions();
if (OpenFile() != 0) if (OpenFile() != 0)
{ {
SetErrored(QObject::tr("Failed to switch title.")); SetErrored(tr("Failed to switch title."));
} }
else else
{ {
Expand Down
6 changes: 6 additions & 0 deletions mythtv/libs/libmythtv/Bluray/mythbdplayer.h
Original file line number Original file line Diff line number Diff line change
@@ -1,10 +1,16 @@
#ifndef MYTHBDPLAYER_H #ifndef MYTHBDPLAYER_H
#define MYTHBDPLAYER_H #define MYTHBDPLAYER_H


// Qt headers
#include <QCoreApplication>

// MythTV headers
#include "mythplayer.h" #include "mythplayer.h"


class MythBDPlayer : public MythPlayer class MythBDPlayer : public MythPlayer
{ {
Q_DECLARE_TR_FUNCTIONS(MythBDPlayer)

public: public:
MythBDPlayer(PlayerFlags flags = kNoFlags); MythBDPlayer(PlayerFlags flags = kNoFlags);
virtual bool HasReachedEof(void) const; virtual bool HasReachedEof(void) const;
Expand Down

0 comments on commit f822630

Please sign in to comment.