Mantis Issue Tracking for Scribus
· Hosting provided by Anduin.net / Øverby Consulting ·

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008666ScribusTranslationpublic09-Dec-30 21:3014-Aug-23 14:54
Reporterspencerjackson 
Assigned Tocbradney 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSArchLinuxOS Version
Product Version1.5.0svn 
Target VersionFixed in Version 
Summary0008666: [PATCH] Docstrings in Python Scripter plugin are not translated
DescriptionIn the Python Scripter plugin, docstrings are marked with the QT_TR_NOOP() macro. However, the QT translation functions are not directly applied against the strings, but rather are encapsulated inside of a function call to the plugin's own definition of tr()(which contains the call to QObject's tr()). I believe because of this degree of remove, QT is unable to translate these docstrings, even though translations have been defined. Further, some docstrings, those in objimageexport.h, objpdffile.h, and objprinter.h, are neither marked for translation, nor processed.
Steps To Reproduce1. Open Scribus in any language other than English
2. Open the Python Console(Script->Show Console)
3. Invoke help(moveObject)

The returned help will be in English.
Additional InformationTo fix this in the attached patch, I did several things. I redefined the PyDoc_STRVAR, so that docstrings were stored in static QStrings. Next, I replaced the QT_TR_NOOP() macro with calls to QCoreApplication::instance()->translate().
 
To translate the docstrings in the obj*.h files, I added translate() functions where appropriate. Then I removed the definition of the plugin's internal tr() function from scriptplugin.cpp, renamed it to formatDocstring(), for consistency as it no longer does any translating, and moved it to its own file. This way, scriptplugin.cpp, and the obj*.cpp files may #include it, and convert the docstrings into char*s. formatDocstring() has been changed slightly, in that now it accepts a reference to a QString, as opposed to attempting to create one itself.
TagsNo tags attached.
Attached Filespatch file icon 0001-Fix-Scripter-docstring-translations.patch [^] (152,016 bytes) 09-Dec-30 21:30 [Show Content]

- Relationships

-  Notes
(0033187)
Kunda (manager)
14-Aug-06 15:33

spencerjackson, doesn't look like the team implemented this. Does your patch still work on the latest 1.5svn version?
(0033320)
Kunda (manager)
14-Aug-23 14:54

ping

- Issue History
Date Modified Username Field Change
09-Dec-30 21:30 spencerjackson New Issue
09-Dec-30 21:30 spencerjackson File Added: 0001-Fix-Scripter-docstring-translations.patch
09-Dec-31 02:26 christoph_s Status new => assigned
09-Dec-31 02:26 christoph_s Assigned To => cbradney
14-Aug-04 04:51 Kunda Summary Docstrings in Python Scripter plugin are not translated[PATCH] => [PATCH] Docstrings in Python Scripter plugin are not translated
14-Aug-06 15:33 Kunda Note Added: 0033187
14-Aug-23 14:54 Kunda Note Added: 0033320



Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker