mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
* Russian translation updated.
* Basic support for translations added, along with the changes necessary to accommodate to it.
This commit is contained in:
parent
ff19ae1fbb
commit
ce365f386b
|
@ -75,7 +75,7 @@ sptr< Dictionary::DataRequest > ArticleMaker::makeDefinitionFor(
|
|||
// This is a special group containing internal welcome/help pages
|
||||
string result = makeHtmlHeader( inWord, QString() );
|
||||
|
||||
if ( inWord == "Welcome!" )
|
||||
if ( inWord == tr( "Welcome!" ) )
|
||||
{
|
||||
result += tr(
|
||||
"<h3 align=\"center\">Welcome to <b>GoldenDict</b>!</h3>"
|
||||
|
@ -96,7 +96,7 @@ sptr< Dictionary::DataRequest > ArticleMaker::makeDefinitionFor(
|
|||
).toUtf8().data();
|
||||
}
|
||||
else
|
||||
if ( inWord == "Working with popup" )
|
||||
if ( inWord == tr( "Working with popup" ) )
|
||||
{
|
||||
result += ( tr( "<h3 align=\"center\">Working with the popup</h3>"
|
||||
|
||||
|
|
|
@ -582,4 +582,13 @@ QString getUserQtCssFileName() throw( exError )
|
|||
return getHomeDir().filePath( "qt-style.css" );
|
||||
}
|
||||
|
||||
QString getProgramDataDir() throw()
|
||||
{
|
||||
#ifdef PROGRAM_DATA_DIR
|
||||
return PROGRAM_DATA_DIR;
|
||||
#else
|
||||
return "foo"; // Fixme
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -186,6 +186,10 @@ QString getUserCssFileName() throw( exError );
|
|||
/// Returns the user .css file name for the Qt interface customization.
|
||||
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
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET =
|
||||
TARGET = goldendict
|
||||
VERSION = 0.8.0
|
||||
#DEPENDPATH += . generators
|
||||
INCLUDEPATH += .
|
||||
|
||||
|
@ -25,6 +26,23 @@ win32 {
|
|||
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
|
||||
HEADERS += folding.hh \
|
||||
inc_case_folding.hh \
|
||||
|
|
1358
src/locale/ru.ts
1358
src/locale/ru.ts
File diff suppressed because it is too large
Load diff
16
src/main.cc
16
src/main.cc
|
@ -27,8 +27,24 @@ int main( int argc, char ** argv )
|
|||
|
||||
QApplication app( argc, argv );
|
||||
|
||||
app.setApplicationName( "GoldenDict" );
|
||||
app.setOrganizationDomain( "http://goldendict.berlios.de/" );
|
||||
|
||||
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
|
||||
{
|
||||
QFile builtInCssFile( ":/qt-style.css" );
|
||||
|
|
|
@ -209,7 +209,7 @@ MainWindow::MainWindow():
|
|||
ArticleView & view =
|
||||
dynamic_cast< ArticleView & >( *( ui.tabWidget->currentWidget() ) );
|
||||
|
||||
view.showDefinition( "Welcome!", UINT_MAX );
|
||||
view.showDefinition( tr( "Welcome!" ), UINT_MAX );
|
||||
}
|
||||
|
||||
ui.translateLine->setFocus();
|
||||
|
|
|
@ -171,10 +171,18 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<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 name="wordWrap">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in a new issue