[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/phonon
From:       Matthias Kretz <kretz () kde ! org>
Date:       2007-05-31 21:18:38
Message-ID: 1180646318.942710.27623.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 670250 by mkretz:

- use Qt's translate functions instead of the noop-i18n in factory.h
- extract the strings into libphonon.pot


 A             Messages.sh   trunk/KDE/kdelibs/Messages.sh#669765
 M  +5 -5      audiooutput.cpp  
 M  +0 -3      factory.h  
 M  +7 -6      phononnamespace.cpp  
 M  +9 -9      volumeslider.cpp  


--- trunk/KDE/kdelibs/phonon/audiooutput.cpp #670249:670250
@@ -272,16 +272,16 @@
     AudioOutputDevice device2 = AudioOutputDevice::fromIndex(outputDeviceIndex);
     switch (type) {
     case FallbackChange:
-        text = i18n("The audio playback device '<i>%1</i>' does not work. "
-            "Falling back to '<i>%2</i>'.", device1.name(), device2.name());
+        text = AudioOutput::tr("The audio playback device '<i>%1</i>' does not work. \
" +            "Falling back to \
'<i>%2</i>'.").arg(device1.name()).arg(device2.name());  break;
     case HigherPreferenceChange:
-        text = i18n("Switching to the audio playback device '<i>%1</i>' "
-                "which just became available and has higher preference.", \
device2.name()); +        text = AudioOutput::tr("Switching to the audio playback \
device '<i>%1</i>' " +                "which just became available and has higher \
preference.").arg(device2.name());  break;
     }
     Factory::notification("AudioDeviceFallback", text,
-            QStringList(i18n("Revert back to device '%1'", device1.name())),
+            QStringList(AudioOutput::tr("Revert back to device \
'%1'").arg(device1.name())),  q, SLOT(_k_revertFallback()));
 }
 
--- trunk/KDE/kdelibs/phonon/factory.h #670249:670250
@@ -33,9 +33,6 @@
     class BasePrivate;
     class AbstractMediaStream;
 
-    inline QString i18n(const QString &text) { return text; }
-    inline QString i18n(const QString &text, const QString &arg1) { return \
                text.arg(arg1); }
-    inline QString i18n(const QString &text, const QString &arg1, const QString \
&arg2) { return text.arg(arg1).arg(arg2); }  /**
  * \internal
  * \brief Factory to access the preferred Backend.
--- trunk/KDE/kdelibs/phonon/phononnamespace.cpp #670249:670250
@@ -22,6 +22,7 @@
 
 #include "factory.h"
 
+#include <QtCore/QCoreApplication>
 #include <QtCore/QList>
 
 namespace Phonon
@@ -31,17 +32,17 @@
         switch(c)
         {
         case Phonon::NotificationCategory:
-            return i18n("Notifications");
+            return QCoreApplication::translate("Phonon::", "Notifications");
         case Phonon::MusicCategory:
-            return i18n("Music");
+            return QCoreApplication::translate("Phonon::", "Music");
         case Phonon::VideoCategory:
-            return i18n("Video");
+            return QCoreApplication::translate("Phonon::", "Video");
         case Phonon::CommunicationCategory:
-            return i18n("Communication");
+            return QCoreApplication::translate("Phonon::", "Communication");
         case Phonon::GameCategory:
-            return i18n("Games");
+            return QCoreApplication::translate("Phonon::", "Games");
         case Phonon::AccessibilityCategory:
-            return i18n("Accessibility");
+            return QCoreApplication::translate("Phonon::", "Accessibility");
         }
         return QString();
     }
--- trunk/KDE/kdelibs/phonon/volumeslider.cpp #670249:670250
@@ -33,8 +33,8 @@
     k_ptr(new VolumeSliderPrivate(this))
 {
     K_D(VolumeSlider);
-    setToolTip(i18n("Volume: %1%", QString::number(100)));
-    setWhatsThis(i18n("Use this slider to adjust the volume. The leftmost position \
is 0%, the rightmost is %1%", QString::number(100))); +    setToolTip(tr("Volume: \
%1%").arg(100)); +    setWhatsThis(tr("Use this slider to adjust the volume. The \
leftmost position is 0%, the rightmost is %1%").arg(100));  
     connect(&d->slider, SIGNAL(valueChanged(int)), SLOT(_k_sliderChanged(int)));
     connect(&d->muteButton, SIGNAL(clicked()), SLOT(_k_buttonClicked()));
@@ -45,8 +45,8 @@
     k_ptr(new VolumeSliderPrivate(this))
 {
     K_D(VolumeSlider);
-    setToolTip(i18n("Volume: %1%", QString::number(100)));
-    setWhatsThis(i18n("Use this slider to adjust the volume. The leftmost position \
is 0%, the rightmost is %1%", QString::number(100))); +    setToolTip(tr("Volume: \
%1%").arg(100)); +    setWhatsThis(tr("Use this slider to adjust the volume. The \
leftmost position is 0%, the rightmost is %1%").arg(100));  
     connect(&d->slider, SIGNAL(valueChanged(int)), SLOT(_k_sliderChanged(int)));
     connect(&d->muteButton, SIGNAL(clicked()), SLOT(_k_buttonClicked()));
@@ -96,8 +96,8 @@
 {
     int max = static_cast<int>(volume * 100);
     k_ptr->slider.setMaximum(max);
-    setWhatsThis(i18n("Use this slider to adjust the volume. The leftmost position \
                is 0%, the rightmost is %1%",
-                QString::number(max)));
+    setWhatsThis(tr("Use this slider to adjust the volume. The leftmost position is \
0%, the rightmost is %1%") +            .arg(max));
 }
 
 Qt::Orientation VolumeSlider::orientation() const
@@ -155,10 +155,10 @@
 {
     Q_Q(VolumeSlider);
     if (muted) {
-        q->setToolTip(i18n("Muted"));
+        q->setToolTip(VolumeSlider::tr("Muted"));
         muteButton.setIcon(mutedIcon);
     } else {
-        q->setToolTip(i18n("Volume: %1%", \
QString::number(static_cast<int>(output->volume() * 100.0)))); +        \
q->setToolTip(VolumeSlider::tr("Volume: %1%").arg(static_cast<int>(output->volume() * \
100.0)));  muteButton.setIcon(volumeIcon);
     }
 }
@@ -169,7 +169,7 @@
 
     if (output) {
         if (!output->isMuted()) {
-           q->setToolTip(i18n("Volume: %1%", QString::number(value)));
+           q->setToolTip(VolumeSlider::tr("Volume: %1%").arg(value));
         }
 
         ignoreVolumeChange = true;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic