src/frontends/qt4/GuiApplication.cpp: fix a bug that prevents translator of languages with long names to be loaded

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@19261 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-07-31 17:18:44 +00:00
parent 3ba9ffc28b
commit 775d93c837

View File

@ -111,7 +111,11 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
// install translation file for Qt built-in dialogs
QString language_name = QString("qt_") + QLocale::system().name();
language_name.truncate(5);
// language_name can be short (e.g. qt_zh) or long (e.g. qt_zh_CN).
// Short-named translator can be loaded from a long name, but not the
// opposite. Therefore, long name should be used without truncation.
// c.f. http://doc.trolltech.com/4.1/qtranslator.html#load
if (qt_trans_.load(language_name,
QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
{