Summary: | Translation of tips does not work | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | stefan.asserhall |
Component: | Usability-i18n | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, jlp, lukas |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 7.5.0 | |
Sentry Crash Report: | |||
Attachments: | Patch to fix translation of tips |
Description
stefan.asserhall
2004-12-19 08:22:20 UTC
CVS commit by coolo: fixing ktip translations BUG: 95437 M +8 -1 ktip.cpp 1.48 M +3 -0 preparetips 1.7 --- kdelibs/kdeui/ktip.cpp #1.47:1.48 @@ -113,5 +113,12 @@ void KTipDatabase::addTips(const QString while ((pos = content.find("<html>", pos + 1, false)) != -1) { - const QString tip = content.mid(pos + 6, content.find("</html>", pos, false) - pos - 6).stripWhiteSpace(); + // to make translations work, tip extraction here must exactly + // match what is done by the preparetips script + QString tip = content + .mid(pos, content.find("</html>", pos, false) - pos) + .stripWhiteSpace() + .mid(6) + "\n"; + if (tip.startsWith("\n")) + tip = tip.mid(1); if (tip.isEmpty()) { --- kdelibs/kdeui/preparetips #1.6:1.7 @@ -5,4 +5,7 @@ # 2000 by Matthias Kiefer <matthias.kiefer@gmx.de> +# IMPORTANT NOTE: Do not change the output without checking if +# translations still work! + sub printText { My patch obviously did not cover all cases. Tips with tabs '\t' and empty lines within the tip 'text\n\ntext' are still not handled correctly (see e.g. kdeedu/kstars/kstars/data/tips). I'm working on an improved patch. Created attachment 9178 [details]
Patch to fix translation of tips
Here is a new patch, that I believe really solves the bug.
This patch has been tested and works with all tips files in CVS.
The now unused "kdebase/ktip/preparetips" can be removed from CVS.
The digikam part of the patch also fixes an untranslatable string in the about
dialog.
I believe this bug is causing bug #98408 (untranslated tips in KStars). So, if you apply Stefan's patch, you'll kill two birds with one stone :) *** Bug 98408 has been marked as a duplicate of this bug. *** I commited all but digikam from the digikam side, the later part of the patch has been applied. thanks. you also referred to an untranslatable string in the about dialog. Which one would that be? The untranslatable string in the about dialog was Description in main.cpp in the patch. I think that strings used as arguments to aboutData must be in English, because of the way KAboutData handles translation. As far as I know, it is not possible to create a string like Description and still be able to translate it, short of creating your own About dialog. Fixed with works from bug #438701 for next 7.5.0 release Gilles Caulier |