Skip to content

Commit

Permalink
Miscellaneous translation fixes
Browse files Browse the repository at this point in the history
Make some strings extractable for translation (they were calling the
translation methods but were not extracted) and change their context
to a more meaningful one.
  • Loading branch information
Nicolas Riendeau committed Jul 14, 2013
1 parent 0e4330b commit 4434906
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
2 changes: 2 additions & 0 deletions mythtv/i18n/translate.pro
Expand Up @@ -2,6 +2,8 @@ SOURCES += ../libs/libmythbase/*.cpp
SOURCES += ../libs/libmythbase/*.h
SOURCES += ../libs/libmyth/*.cpp
SOURCES += ../libs/libmyth/*.h
SOURCES += ../libs/libmyth/audio/*.cpp
SOURCES += ../libs/libmyth/audio/*.h
SOURCES += ../libs/libmythmetadata/*.cpp
SOURCES += ../libs/libmythtv/*.cpp
SOURCES += ../libs/libmythtv/*.h
Expand Down
28 changes: 14 additions & 14 deletions mythtv/libs/libmyth/audio/audiooutputjack.cpp
Expand Up @@ -65,7 +65,7 @@ AudioOutputSettings* AudioOutputJACK::GetOutputSettings(bool /*digital*/)
client = _jack_client_open();
if (!client)
{
JERROR(QObject::tr("Cannot start/connect to jack server "
JERROR(tr("Cannot start/connect to jack server "
"(to check supported rate/channels)"));
delete settings;
return NULL;
Expand All @@ -76,7 +76,7 @@ AudioOutputSettings* AudioOutputJACK::GetOutputSettings(bool /*digital*/)

if (!rate)
{
JERROR(QObject::tr("Unable to retrieve jack server sample rate"));
JERROR(tr("Unable to retrieve jack server sample rate"));
goto err_out;
}
else
Expand All @@ -90,7 +90,7 @@ AudioOutputSettings* AudioOutputJACK::GetOutputSettings(bool /*digital*/)

if (!matching_ports || !matching_ports[0])
{
JERROR(QObject::tr("No ports available to connect to"));
JERROR(tr("No ports available to connect to"));
goto err_out;
}
// Count matching ports from 2nd port upwards
Expand Down Expand Up @@ -130,7 +130,7 @@ bool AudioOutputJACK::OpenDevice()
// We have a hard coded channel limit - check we haven't exceeded it
if (channels > JACK_CHANNELS_MAX)
{
JERROR(QObject::tr("Requested more channels: (%1), than the maximum: %2")
JERROR(tr("Requested more channels: (%1), than the maximum: %2")
.arg(channels).arg(JACK_CHANNELS_MAX));
return false;
}
Expand All @@ -146,15 +146,15 @@ bool AudioOutputJACK::OpenDevice()
client = _jack_client_open();
if (!client)
{
JERROR(QObject::tr("Cannot start/connect to jack server"));
JERROR(tr("Cannot start/connect to jack server"));
goto err_out;
}

// Find some Jack ports to connect to
matching_ports = _jack_get_ports();
if (!matching_ports || !matching_ports[0])
{
JERROR(QObject::tr("No ports available to connect to"));
JERROR(tr("No ports available to connect to"));
goto err_out;
}

Expand All @@ -165,7 +165,7 @@ bool AudioOutputJACK::OpenDevice()
// ensure enough ports to satisfy request
if (channels > i)
{
JERROR(QObject::tr("Not enough ports available to connect to"));
JERROR(tr("Not enough ports available to connect to"));
goto err_out;
}

Expand All @@ -178,7 +178,7 @@ bool AudioOutputJACK::OpenDevice()
JackPortIsOutput, 0);
if (!ports[i])
{
JERROR(QObject::tr("Error while registering new jack port: %1").arg(i));
JERROR(tr("Error while registering new jack port: %1").arg(i));
goto err_out;
}
}
Expand All @@ -199,16 +199,16 @@ bool AudioOutputJACK::OpenDevice()
// These will actually get called after jack_activate()!
// ...Possibly even before this OpenDevice sub returns...
if (jack_set_process_callback(client, _JackCallback, this))
JERROR(QObject::tr("Error. Unable to set process callback?!"));
JERROR(tr("Error. Unable to set process callback?!"));
if (jack_set_xrun_callback(client, _JackXRunCallback, this))
JERROR(QObject::tr("Error. Unable to set xrun callback?!"));
JERROR(tr("Error. Unable to set xrun callback?!"));
if (jack_set_graph_order_callback(client, _JackGraphOrderCallback, this))
JERROR(QObject::tr("Error. Unable to set graph order change callback?!"));
JERROR(tr("Error. Unable to set graph order change callback?!"));

// Activate! Everything comes into life after here. Beware races
if (jack_activate(client))
{
JERROR(QObject::tr("Calling jack_activate failed"));
JERROR(tr("Calling jack_activate failed"));
goto err_out;
}

Expand Down Expand Up @@ -615,7 +615,7 @@ bool AudioOutputJACK::_jack_connect_ports(const char** matching_ports)
{
if (jack_connect(client, jack_port_name(ports[i]), matching_ports[i]))
{
JERROR(QObject::tr("Calling jack_connect failed on port: %1\n").arg(i));
JERROR(tr("Calling jack_connect failed on port: %1\n").arg(i));
return false;
}
}
Expand All @@ -629,7 +629,7 @@ void AudioOutputJACK::_jack_client_close(jack_client_t **client)
{
int err = jack_client_close(*client);
if (err != 0)
JERROR(QObject::tr("Error closing Jack output device. Error: %1")
JERROR(tr("Error closing Jack output device. Error: %1")
.arg(err));
*client = NULL;
}
Expand Down
5 changes: 5 additions & 0 deletions mythtv/libs/libmyth/audio/audiooutputjack.h
@@ -1,6 +1,9 @@
#ifndef AUDIOOUTPUTJACK
#define AUDIOOUTPUTJACK

// Qt headers
#include <QCoreApplication>

#include <jack/jack.h>
#include <jack/statistics.h>
#include "audiooutputbase.h"
Expand All @@ -14,6 +17,8 @@ using namespace std;

class AudioOutputJACK : public AudioOutputBase
{
Q_DECLARE_TR_FUNCTIONS(AudioOutputJACK)

public:
AudioOutputJACK(const AudioSettings &settings);
virtual ~AudioOutputJACK();
Expand Down

0 comments on commit 4434906

Please sign in to comment.