From e1076527bab412f43e38697f93c5306a84d6c58f Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Tue, 31 Jul 2007 17:09:50 +0000 Subject: [PATCH] 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/trunk@19259 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiApplication.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 3574188e86..3d167ebce2 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -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))) {