]> git.lyx.org Git - features.git/commitdiff
src/frontends/qt4/GuiApplication.cpp: fix a bug that prevents translator of languages...
authorBo Peng <bpeng@lyx.org>
Tue, 31 Jul 2007 17:09:50 +0000 (17:09 +0000)
committerBo Peng <bpeng@lyx.org>
Tue, 31 Jul 2007 17:09:50 +0000 (17:09 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19259 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiApplication.cpp

index 3574188e86e27240fd8e553f27ef82ec235c4019..3d167ebce2ca8b837351e83c0a98d61168776b8d 100644 (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)))
        {