[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: Re: Scanning in Kword, where do these strings come from?
From: Stefan =?iso-8859-1?q?Asserh=E4ll?= <stefan.asserhall () comhem ! se>
Date: 2005-04-18 16:31:26
Message-ID: 200504181831.26233.stefan.asserhall () comhem ! se
[Download RAW message or body]
On Monday 18 April 2005 13.16, Brad Hards wrote:
> I think they must come from SANE - the underlying scanner library.
> It definitely has the string "Use custom gamma table".
Yes. Here is a patch to include the backend translation that works
for me. It assumes that a translation is available for sane backends
in /usr/share/locale/xx/LC_MESSAGES/sane-backends.mo, which is true
for my distribution (Fedora Core, sane-backends-1.0.13-7) for bg,
cs, de, es, fr, it, nl, no, pt, ru and sv.
Since the patch relies on the sane-backends translation (done outside
of KDE), I don't think it is the "right way" to do it, that's why I
haven't submitted the patch before.
/ Stefan
["libkscan1.diff" (text/x-diff)]
Index: kscandevice.cpp
===================================================================
RCS file: /home/kde/kdegraphics/libkscan/kscandevice.cpp,v
retrieving revision 1.48
diff -u -3 -p -r1.48 kscandevice.cpp
--- kscandevice.cpp 8 Jan 2005 02:38:35 -0000 1.48
+++ kscandevice.cpp 29 Jan 2005 12:02:32 -0000
@@ -165,6 +165,10 @@ KScanOption *KScanDevice::getGuiElement(
KScanDevice::KScanDevice( QObject *parent )
: QObject( parent )
{
+ /* Get sane translations */
+ KGlobal::dirs()->addResourceDir( "locale", QString::fromLatin1("/usr/share/locale/") );
+ KGlobal::locale()->insertCatalogue( QString::fromLatin1("sane-backends") );
+
SANE_Status sane_stat = sane_init(NULL, NULL );
d = new KScanDevicePrivate();
Index: kscanoption.cpp
===================================================================
RCS file: /home/kde/kdegraphics/libkscan/kscanoption.cpp,v
retrieving revision 1.23
diff -u -3 -p -r1.23 kscanoption.cpp
--- kscanoption.cpp 16 Nov 2004 18:07:25 -0000 1.23
+++ kscanoption.cpp 29 Jan 2005 12:02:32 -0000
@@ -32,6 +32,7 @@
#include <qregexp.h>
#include <kdebug.h>
+#include <klocale.h>
#include <unistd.h>
#include "kgammatable.h"
@@ -1084,7 +1085,7 @@ QWidget *KScanOption::createWidget( QWid
{
case BOOL:
/* Widget Type is ToggleButton */
- w = new QCheckBox( text, parent, "AUTO_TOGGLE_BUTTON" );
+ w = new QCheckBox( i18n(text.utf8()), parent, "AUTO_TOGGLE_BUTTON" );
connect( w, SIGNAL(clicked()), this,
SLOT(slWidgetChange()));
break;
@@ -1127,7 +1128,7 @@ QWidget *KScanOption::createWidget( QWid
tt = QString::fromLocal8Bit( desc->desc );
if( !tt.isEmpty() )
- QToolTip::add( internal_widget, tt );
+ QToolTip::add( internal_widget, i18n(tt.utf8()) );
}
/* Check if option is active, setEnabled etc. */
Index: kscanslider.cpp
===================================================================
RCS file: /home/kde/kdegraphics/libkscan/kscanslider.cpp,v
retrieving revision 1.18
diff -u -3 -p -r1.18 kscanslider.cpp
--- kscanslider.cpp 16 Nov 2004 18:07:25 -0000 1.18
+++ kscanslider.cpp 29 Jan 2005 12:02:33 -0000
@@ -39,7 +39,7 @@ KScanSlider::KScanSlider( QWidget *paren
m_stdButt(0)
{
QHBoxLayout *hb = new QHBoxLayout( this );
- l1 = new QLabel( text, this, "AUTO_SLIDER_LABEL" );
+ l1 = new QLabel( i18n(text.utf8()), this, "AUTO_SLIDER_LABEL" );
hb->addWidget( l1,20 );
if( haveStdButt )
@@ -154,7 +154,7 @@ KScanEntry::KScanEntry( QWidget *parent,
{
QHBoxLayout *hb = new QHBoxLayout( this );
- QLabel *l1 = new QLabel( text, this, "AUTO_ENTRYFIELD" );
+ QLabel *l1 = new QLabel( i18n(text.utf8()), this, "AUTO_ENTRYFIELD" );
hb->addWidget( l1,1 );
entry = new QLineEdit( this, "AUTO_ENTRYFIELD_E" );
@@ -220,7 +220,9 @@ KScanCombo::KScanCombo( QWidget *parent,
{
createCombo( text );
if( combo )
- combo->insertStrList( list);
+ for ( QStrList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
+ combo->insertItem( i18n(*it) );
+ }
combolist = list;
}
@@ -230,10 +232,10 @@ KScanCombo::KScanCombo( QWidget *parent,
combo(0)
{
createCombo( text );
- if( combo )
- combo->insertStringList( list );
for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
+ if( combo )
+ combo->insertItem( i18n( (*it).utf8() ) );
combolist.append( (*it).local8Bit() );
}
}
@@ -245,7 +247,7 @@ void KScanCombo::createCombo( const QStr
setMargin( 2 );
- (void) new QLabel( text, this, "AUTO_COMBOLABEL" );
+ (void) new QLabel( i18n(text.utf8()), this, "AUTO_COMBOLABEL" );
combo = new QComboBox( this, "AUTO_COMBO" );
Index: scanparams.cpp
===================================================================
RCS file: /home/kde/kdegraphics/libkscan/scanparams.cpp,v
retrieving revision 1.47
diff -u -3 -p -r1.47 scanparams.cpp
--- scanparams.cpp 16 Nov 2004 18:07:25 -0000 1.47
+++ scanparams.cpp 29 Jan 2005 12:02:34 -0000
@@ -246,7 +246,7 @@ QScrollView *ScanParams::scannerParams(
cb->slSetIcon( pixLineArt, i18n("Lineart"));
cb->slSetIcon( pixLineArt, i18n("Binary" ));
cb->slSetIcon( pixGray, i18n("Gray") );
- cb->slSetIcon( pixGray, i18n("Gray") );
+ cb->slSetIcon( pixGray, i18n("Grey") );
cb->slSetIcon( pixColor, i18n("Color") );
cb->slSetIcon( pixHalftone, i18n("Halftone") );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic