r19850 by craig - #12928: Insufficient justification of Japanese text
scribus-commit
scribus-commit at lists.scribus.net
Sun Feb 22 16:21:42 UTC 2015
Author: craig
Date: Sun Feb 22 16:21:42 2015
New Revision: 19850
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19850
Log:
#12928: Insufficient justification of Japanese text
Modified:
branches/Version14x/Scribus/scribus/scribusapp.cpp
Modified: branches/Version14x/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19850&path=/branches/Version14x/Scribus/scribus/scribusapp.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusapp.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribusapp.cpp Sun Feb 22 16:21:42 2015
@@ -333,20 +333,29 @@
void ScribusQApp::installTranslators(const QStringList & langs)
{
+ static QTranslator *transQt = 0;
static QTranslator *trans = 0;
+ if (transQt)
+ {
+ removeTranslator( transQt );
+ delete transQt;
+ transQt=0;
+ }
if ( trans )
{
removeTranslator( trans );
delete trans;
}
+
+ transQt = new QTranslator(0);
trans = new QTranslator(0);
QString path(ScPaths::instance().translationDir());
- path += "scribus";
-
- bool loaded = false;
+
+ bool loadedQt = false;
+ bool loadedScribus = false;
QString lang;
- for (QStringList::const_iterator it = langs.constBegin(); it != langs.constEnd() && !loaded; ++it)
+ for (QStringList::const_iterator it = langs.constBegin(); it != langs.constEnd() && !loadedScribus; ++it)
{
lang=(*it);
if (lang == "en")
@@ -354,10 +363,18 @@
GUILang=lang;
break;
}
- else if (trans->load(QString(path + '.' + lang), "."))
- loaded = true;
- }
- if (loaded)
+ else
+ {
+ //CB: This might need adjusting for qm files distribution locations
+ if (transQt->load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+ loadedQt = true;
+ if (trans->load(QString("scribus." + lang), path))
+ loadedScribus = true;
+ }
+ }
+ if (loadedQt)
+ installTranslator(transQt);
+ if (loadedScribus)
{
installTranslator(trans);
GUILang=lang;
More information about the scribus-commit
mailing list