* Russian translation updated.

* Basic support for translations added, along with the changes necessary to
  accommodate to it.
This commit is contained in:
Konstantin Isakov 2009-04-12 19:41:58 +00:00
parent ff19ae1fbb
commit ce365f386b
8 changed files with 1326 additions and 99 deletions

View file

@ -75,7 +75,7 @@ sptr< Dictionary::DataRequest > ArticleMaker::makeDefinitionFor(
// This is a special group containing internal welcome/help pages // This is a special group containing internal welcome/help pages
string result = makeHtmlHeader( inWord, QString() ); string result = makeHtmlHeader( inWord, QString() );
if ( inWord == "Welcome!" ) if ( inWord == tr( "Welcome!" ) )
{ {
result += tr( result += tr(
"<h3 align=\"center\">Welcome to <b>GoldenDict</b>!</h3>" "<h3 align=\"center\">Welcome to <b>GoldenDict</b>!</h3>"
@ -96,7 +96,7 @@ sptr< Dictionary::DataRequest > ArticleMaker::makeDefinitionFor(
).toUtf8().data(); ).toUtf8().data();
} }
else else
if ( inWord == "Working with popup" ) if ( inWord == tr( "Working with popup" ) )
{ {
result += ( tr( "<h3 align=\"center\">Working with the popup</h3>" result += ( tr( "<h3 align=\"center\">Working with the popup</h3>"

View file

@ -582,4 +582,13 @@ QString getUserQtCssFileName() throw( exError )
return getHomeDir().filePath( "qt-style.css" ); return getHomeDir().filePath( "qt-style.css" );
} }
QString getProgramDataDir() throw()
{
#ifdef PROGRAM_DATA_DIR
return PROGRAM_DATA_DIR;
#else
return "foo"; // Fixme
#endif
}
} }

View file

@ -186,6 +186,10 @@ QString getUserCssFileName() throw( exError );
/// Returns the user .css file name for the Qt interface customization. /// Returns the user .css file name for the Qt interface customization.
QString getUserQtCssFileName() throw( exError ); QString getUserQtCssFileName() throw( exError );
/// Returns the program's data dir. Under Linux that would be something like
/// /usr/share/apps/goldendict, under Windows C:/Program Files/GoldenDict.
QString getProgramDataDir() throw();
} }
#endif #endif

View file

@ -3,7 +3,8 @@
###################################################################### ######################################################################
TEMPLATE = app TEMPLATE = app
TARGET = TARGET = goldendict
VERSION = 0.8.0
#DEPENDPATH += . generators #DEPENDPATH += . generators
INCLUDEPATH += . INCLUDEPATH += .
@ -25,6 +26,23 @@ win32 {
RC_FILE = goldendict.rc RC_FILE = goldendict.rc
} }
unix {
PREFIX = $$(PREFIX)
isEmpty( PREFIX ) {
PREFIX = /usr/local
}
DEFINES += PROGRAM_DATA_DIR=\\\"$$PREFIX/share/apps/goldendict/\\\"
target.path = $$PREFIX/bin/
locale.path = $$PREFIX/share/apps/goldendict/locale/
locale.files = locale/ru.qm
INSTALLS += target locale
}
# Input # Input
HEADERS += folding.hh \ HEADERS += folding.hh \
inc_case_folding.hh \ inc_case_folding.hh \

File diff suppressed because it is too large Load diff

View file

@ -27,8 +27,24 @@ int main( int argc, char ** argv )
QApplication app( argc, argv ); QApplication app( argc, argv );
app.setApplicationName( "GoldenDict" );
app.setOrganizationDomain( "http://goldendict.berlios.de/" );
app.setWindowIcon( QIcon( ":/icons/programicon.png" ) ); app.setWindowIcon( QIcon( ":/icons/programicon.png" ) );
// Load translations
QTranslator qtTranslator;
qtTranslator.load( "qt_" + QLocale::system().name(),
QLibraryInfo::location( QLibraryInfo::TranslationsPath ) );
app.installTranslator( &qtTranslator );
QTranslator translator;
translator.load( QString( Config::getProgramDataDir() ) + "/locale/" + QLocale::system().name() );
app.installTranslator( &translator );
// Apply qt stylesheet // Apply qt stylesheet
{ {
QFile builtInCssFile( ":/qt-style.css" ); QFile builtInCssFile( ":/qt-style.css" );

View file

@ -209,7 +209,7 @@ MainWindow::MainWindow():
ArticleView & view = ArticleView & view =
dynamic_cast< ArticleView & >( *( ui.tabWidget->currentWidget() ) ); dynamic_cast< ArticleView & >( *( ui.tabWidget->currentWidget() ) );
view.showDefinition( "Welcome!", UINT_MAX ); view.showDefinition( tr( "Welcome!" ), UINT_MAX );
} }
ui.translateLine->setFocus(); ui.translateLine->setFocus();

View file

@ -171,10 +171,18 @@
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Each morphology dictionary appears as a separate auxiliary dictionary which provides stem words for searches and spelling suggestions for mistyped words. Add appropriate dictionaries to the bottoms of the appropriate groups to use them.</string> <string>Each morphology dictionary appears as a
separate auxiliary dictionary which
provides stem words for searches and
spelling suggestions for mistyped words.
Add appropriate dictionaries to the bottoms
of the appropriate groups to use them.</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>