Commit 8ac498d3 authored by Robert Knight's avatar Robert Knight

i18n fixes from Stefan Asserhall.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=685630
parent 5be4ac86
......@@ -84,28 +84,28 @@ const char* ColorScheme::colorNames[TABLE_COLORS] =
"Color6Intense",
"Color7Intense"
};
const QString ColorScheme::translatedColorNames[TABLE_COLORS] =
{
i18n("Foreground"),
i18n("Background"),
i18n("Color 1"),
i18n("Color 2"),
i18n("Color 3"),
i18n("Color 4"),
i18n("Color 5"),
i18n("Color 6"),
i18n("Color 7"),
i18n("Color 8"),
i18n("Foreground (Intense)"),
i18n("Background (Intense)"),
i18n("Color 1 (Intense)"),
i18n("Color 2 (Intense)"),
i18n("Color 3 (Intense)"),
i18n("Color 4 (Intense)"),
i18n("Color 5 (Intense)"),
i18n("Color 6 (Intense)"),
i18n("Color 7 (Intense)"),
i18n("Color 8 (Intense)")
const char* ColorScheme::translatedColorNames[TABLE_COLORS] =
{
I18N_NOOP("Foreground"),
I18N_NOOP("Background"),
I18N_NOOP("Color 1"),
I18N_NOOP("Color 2"),
I18N_NOOP("Color 3"),
I18N_NOOP("Color 4"),
I18N_NOOP("Color 5"),
I18N_NOOP("Color 6"),
I18N_NOOP("Color 7"),
I18N_NOOP("Color 8"),
I18N_NOOP("Foreground (Intense)"),
I18N_NOOP("Background (Intense)"),
I18N_NOOP("Color 1 (Intense)"),
I18N_NOOP("Color 2 (Intense)"),
I18N_NOOP("Color 3 (Intense)"),
I18N_NOOP("Color 4 (Intense)"),
I18N_NOOP("Color 5 (Intense)"),
I18N_NOOP("Color 6 (Intense)"),
I18N_NOOP("Color 7 (Intense)"),
I18N_NOOP("Color 8 (Intense)")
};
ColorSchemeManager* ColorSchemeManager::_instance = 0;
......@@ -239,8 +239,10 @@ qreal ColorScheme::opacity() const { return _opacity; }
void ColorScheme::read(KConfig& config)
{
KConfigGroup configGroup = config.group("General");
_description = configGroup.readEntry("Description",i18n("Un-named Color Scheme"));
QString description = configGroup.readEntry("Description", I18N_NOOP("Un-named Color Scheme"));
_description = i18n(description.toUtf8());
_opacity = configGroup.readEntry("Opacity",qreal(1.0));
for (int i=0 ; i < TABLE_COLORS ; i++)
......@@ -271,7 +273,7 @@ QString ColorScheme::translatedColorNameForIndex(int index)
{
Q_ASSERT( index >= 0 && index < TABLE_COLORS );
return QString(translatedColorNames[index]);
return i18n(translatedColorNames[index]);
}
void ColorScheme::readColorEntry(KConfig& config , int index)
{
......@@ -376,7 +378,9 @@ void KDE3ColorSchemeReader::readTitleLine(const QString& line,ColorScheme* schem
int spacePos = line.indexOf(' ');
Q_ASSERT( spacePos != -1 );
scheme->setDescription(line.mid(spacePos+1));
QString description = line.mid(spacePos+1);
scheme->setDescription(i18n(description.toUtf8()));
}
ColorSchemeManager::ColorSchemeManager()
: _haveLoadedAll(false)
......
......@@ -175,7 +175,7 @@ private:
// randomization
static const char* colorNames[TABLE_COLORS];
static const QString translatedColorNames[TABLE_COLORS];
static const char* translatedColorNames[TABLE_COLORS];
static const ColorEntry defaultTable[]; // table of default color entries
};
......
......@@ -206,6 +206,15 @@ public:
/** Resets the state of the terminal. */
virtual void reset() =0;
/**
* Returns true if the active terminal program wants
* mouse input events.
*
* The programUsesMouseChanged() signal is emitted when this
* changes.
*/
bool programUsesMouse() const;
public slots:
/** Change the size of the emulation's image */
......@@ -300,7 +309,7 @@ signals:
* @param usesMouse This will be true if the program wants to be informed about
* mouse events or false otherwise.
*/
void programUsesMouse(bool usesMouse);
void programUsesMouseChanged(bool usesMouse);
/**
* Emitted when the contents of the screen image change.
......
......@@ -49,7 +49,7 @@ IncrementalSearchBar::IncrementalSearchBar(Features features , QWidget* parent)
QToolButton* close = new QToolButton(this);
close->setObjectName("close-button");
close->setToolTip("Close the search bar");
close->setToolTip( i18n("Close the search bar") );
close->setAutoRaise(true);
close->setIcon(KIcon("dialog-cancel"));
connect( close , SIGNAL(clicked()) , this , SIGNAL(closeClicked()) );
......@@ -58,7 +58,7 @@ IncrementalSearchBar::IncrementalSearchBar(Features features , QWidget* parent)
_searchEdit = new QLineEdit(this);
_searchEdit->installEventFilter(this);
_searchEdit->setObjectName("search-edit");
_searchEdit->setToolTip("Enter the text to search for here");
_searchEdit->setToolTip( i18n("Enter the text to search for here") );
// text box may be a minimum of 6 characters wide and a maximum of 10 characters wide
// (since the maxWidth metric is used here, more characters probably will fit in than 6
......@@ -80,7 +80,7 @@ IncrementalSearchBar::IncrementalSearchBar(Features features , QWidget* parent)
findNext->setAutoRaise(true);
findNext->setIcon( KIcon("find-next") );
findNext->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
findNext->setToolTip("Find the next match for the current search phrase");
findNext->setToolTip( i18n("Find the next match for the current search phrase") );
connect( findNext , SIGNAL(clicked()) , this , SIGNAL(findNextClicked()) );
QToolButton* findPrev = new QToolButton(this);
......@@ -89,14 +89,14 @@ IncrementalSearchBar::IncrementalSearchBar(Features features , QWidget* parent)
findPrev->setAutoRaise(true);
findPrev->setIcon( KIcon("find-previous") );
findPrev->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
findPrev->setToolTip("Find the previous match for the current search phrase");
findPrev->setToolTip( i18n("Find the previous match for the current search phrase") );
connect( findPrev , SIGNAL(clicked()) , this , SIGNAL(findPreviousClicked()) );
if ( features & HighlightMatches )
{
_highlightBox = new QCheckBox( i18n("Highlight all") , this );
_highlightBox->setObjectName("highlight-matches-box");
_highlightBox->setToolTip("Sets whether matching text should be highlighted");
_highlightBox->setToolTip( i18n("Sets whether matching text should be highlighted") );
_highlightBox->setChecked(true);
connect( _highlightBox , SIGNAL(toggled(bool)) , this ,
SIGNAL(highlightMatchesToggled(bool)) );
......@@ -106,7 +106,7 @@ IncrementalSearchBar::IncrementalSearchBar(Features features , QWidget* parent)
{
_matchCaseBox = new QCheckBox( i18n("Match case") , this );
_matchCaseBox->setObjectName("match-case-box");
_matchCaseBox->setToolTip("Sets whether the searching is case sensitive");
_matchCaseBox->setToolTip( i18n("Sets whether the searching is case sensitive") );
connect( _matchCaseBox , SIGNAL(toggled(bool)) , this , SIGNAL(matchCaseToggled(bool)) );
}
......@@ -114,8 +114,8 @@ IncrementalSearchBar::IncrementalSearchBar(Features features , QWidget* parent)
{
_matchRegExpBox = new QCheckBox( i18n("Match regular expression") , this );
_matchRegExpBox->setObjectName("match-regexp-box");
_matchRegExpBox->setToolTip("Sets whether the search phrase is interpreted as normal text or"
" as a regular expression");
_matchRegExpBox->setToolTip( i18n("Sets whether the search phrase is interpreted as normal text or"
" as a regular expression") );
connect( _matchRegExpBox , SIGNAL(toggled(bool)) , this , SIGNAL(matchRegExpToggled(bool)) );
}
......
......@@ -35,6 +35,7 @@
#include <QtGui/QKeySequence>
// KDE
#include <KLocale>
#include <KStandardDirs>
using namespace Konsole;
......@@ -213,7 +214,7 @@ KeyboardTranslatorReader::KeyboardTranslatorReader( QIODevice* source )
if ( !tokens.isEmpty() && tokens.first().type == Token::TitleKeyword )
{
_description = tokens[1].text;
_description = i18n(tokens[1].text.toUtf8());
}
}
......
......@@ -183,7 +183,7 @@ void MainWindow::setupActions()
_toggleMenuBarAction = new KToggleAction(this);
_toggleMenuBarAction->setText( i18n("Show Menu Bar") );
_toggleMenuBarAction->setIcon( KIcon("show-menu") );
_toggleMenuBarAction->setCheckedState( KGuiItem("Hide Menu Bar","show-menu") );
_toggleMenuBarAction->setCheckedState( KGuiItem( i18n("Hide Menu Bar") , "show-menu") );
_toggleMenuBarAction->setChecked( !menuBar()->isHidden() );
connect( _toggleMenuBarAction , SIGNAL(toggled(bool)) , menuBar() , SLOT(setVisible(bool)) );
collection->addAction("show-menubar",_toggleMenuBarAction);
......
......@@ -4,9 +4,14 @@ rm -f schemas.cpp
for i in ../data/color-schemes/*.schema; do
grep "^title" $i | cut -d':' -f2- | sed -e 's#^title \(.*\)$#i18n(\"\1\")#' >> schemas.cpp
done
for i in ../data/color-schemes/*.colorscheme; do
grep "^Description=" $i | sed -e 's#^Description=\(.*\)$#i18n(\"\1\")#' >> schemas.cpp
done
for i in ../data/keyboard-layouts/*.keytab; do
grep "^keyboard" $i | sed -e 's#^keyboard \"\(.*\)\"$#i18n(\"\1\")#' >> schemas.cpp
done
$EXTRACTRC `find . -name \*.ui` > rc.cpp
$EXTRACTRC `find ../desktop -name \*.rc` >> rc.cpp
$XGETTEXT *.cpp -o $podir/konsole.pot
rm -f schemas.cpp
rm -f tips.cpp
......@@ -194,7 +194,7 @@ void Session::addView(TerminalDisplay* widget)
// allow emulation to notify view when the foreground process
// indicates whether or not it is interested in mouse signals
connect( _emulation , SIGNAL(programUsesMouse(bool)) , widget ,
connect( _emulation , SIGNAL(programUsesMouseChanged(bool)) , widget ,
SLOT(setUsesMouse(bool)) );
widget->setScreenWindow(_emulation->createWindow());
......
......@@ -31,18 +31,18 @@ using namespace Konsole;
const TabTitleFormatAction::Element TabTitleFormatAction::_localElements[] =
{
{ "%n" , i18n("Program name") },
{ "%d" , i18n("Current directory (Short)") },
{ "%D" , i18n("Current directory (Long)") },
{ "%w" , i18n("Window title set by shell") }
{ "%n" , I18N_NOOP("Program name") },
{ "%d" , I18N_NOOP("Current directory (Short)") },
{ "%D" , I18N_NOOP("Current directory (Long)") },
{ "%w" , I18N_NOOP("Window title set by shell") }
};
const int TabTitleFormatAction::_localElementCount = 4;
const TabTitleFormatAction::Element TabTitleFormatAction::_remoteElements[] =
{
{ "%u" , i18n("User name") },
{ "%h" , i18n("Remote host (Short)") },
{ "%H" , i18n("Remote host (Long)") },
{ "%w" , i18n("Window title set by shell") }
{ "%u" , I18N_NOOP("User name") },
{ "%h" , I18N_NOOP("Remote host (Short)") },
{ "%H" , I18N_NOOP("Remote host (Long)") },
{ "%w" , I18N_NOOP("Window title set by shell") }
};
const int TabTitleFormatAction::_remoteElementCount = 4;
......@@ -85,7 +85,7 @@ void TabTitleFormatAction::setContext(Session::TabTitleContext context)
for ( int i = 0 ; i < count ; i++ )
{
QAction* action = new QAction(array[i].description,this);
QAction* action = new QAction(i18n(array[i].description),this);
action->setData(array[i].element);
list << action;
}
......
......@@ -52,7 +52,7 @@ private:
struct Element
{
QString element;
QString description;
char *description;
};
static const Element _localElements[];
static const int _localElementCount;
......
......@@ -1231,7 +1231,7 @@ void Vt102Emulation::setMode(int m)
case MODE_Mouse1001:
case MODE_Mouse1002:
case MODE_Mouse1003:
emit programUsesMouse(false);
emit programUsesMouseChanged(false);
break;
case MODE_AppScreen : _screen[1]->clearSelection();
......@@ -1254,7 +1254,7 @@ void Vt102Emulation::resetMode(int m)
case MODE_Mouse1001 :
case MODE_Mouse1002 :
case MODE_Mouse1003 :
emit programUsesMouse(true);
emit programUsesMouseChanged(true);
break;
case MODE_AppScreen : _screen[0]->clearSelection();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment