A Dilluns, 13 de setembre de 2010, Burkhard Lück va escriure: > Hi, > > I noticed two catalog/translation problems with KOffice: > > 1) in branch 2.2 > In "What's This? Shift+F1" the key name "Shift" has the wrong message > translation from the krita catalog in the start window of krita and the > application windows of Krita, Karbon, KWord and KSpread. > > Shown is this translation from krita.po: > #. i18n: file: image/tests/kis_random_generator_demo.ui:105 > #. i18n: ectx: property (text), widget (QLabel, label_4) > #: rc.cpp:2804 > msgid "Shift" > > The correct translation should be pulled from kdeqt.po > #: gui/kernel/qkeysequence.cpp:1157 gui/kernel/qkeysequence.cpp:1295 > msgid "Shift" > > To solve that the string "Shift" in kis_random_generator_demo.ui needs a > context. > > The krita catalog is loaded for krita via the application name and for > Karbon, KWord and KSpread via the plugin defaulttools > krita/plugins/tools/defaulttools/default_tools.cc:44: > K_EXPORT_PLUGIN(DefaultToolsFactory("krita")) > > > 2) in trunk all koffice applications (and some other apps e.g. kpat) are > completely untranslated here in locale x-test. Looks something similar like > https://bugs.kde.org/show_bug.cgi?id=232918 is back? > > Can anyone please check and probably confirm these issues? Yeah, dfaure broke it. I have a patch that fixes it, but touches too much kdecore vodoo i'm not sure it's correct. I'll pass it though him before commiting. The patch is Index: kernel/kglobal.cpp =================================================================== --- kernel/kglobal.cpp (revision 1174986) +++ kernel/kglobal.cpp (working copy) @@ -73,7 +73,8 @@ inline KGlobalPrivate() : stringDict(0), locale(0), - charsets(0) + charsets(0), + localeIsFromFakeComponent(false) { // the umask is read here before any threads are created to avoid race conditions mode_t tmp = 0; @@ -96,6 +97,7 @@ KStringDict *stringDict; KLocale *locale; KCharsets *charsets; + bool localeIsFromFakeComponent; /** * This component may be used in applications that doesn't have a @@ -148,8 +150,11 @@ KLocale *KGlobal::locale() { PRIVATE_DATA; - if (d->locale == 0) { + if (d->locale == 0 || (d->localeIsFromFakeComponent && d- >mainComponent.isValid() && d->mainComponent.config())) { + delete d->locale; + d->locale = 0; d->locale = new KLocale(mainComponent().catalogName()); + d->localeIsFromFakeComponent = !d->mainComponent.isValid(); QTextCodec::setCodecForLocale(d->locale->codecForEncoding()); mainComponent().aboutData()->translateInternalProgramName(); QCoreApplication* coreApp = QCoreApplication::instance(); Albert > > Thanks.