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

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008666ScribusTranslationpublic2009-12-30 21:302015-01-30 00:24
Assigned Tocbradney 
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) 2009-12-30 21:30 [Show Content]

- Relationships
related to 0002371acknowledged Split GUI and Scripter translation files 

-  Notes
Kunda (manager)
2014-08-06 15:33

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

Kunda (manager)
2015-01-30 00:24

Spencerjackson, please respond.

- Issue History
Date Modified Username Field Change
2009-12-30 21:30 spencerjackson New Issue
2009-12-30 21:30 spencerjackson File Added: 0001-Fix-Scripter-docstring-translations.patch
2009-12-31 02:26 christoph_s Status new => assigned
2009-12-31 02:26 christoph_s Assigned To => cbradney
2014-08-04 04:51 Kunda Summary Docstrings in Python Scripter plugin are not translated[PATCH] => [PATCH] Docstrings in Python Scripter plugin are not translated
2014-08-06 15:33 Kunda Note Added: 0033187
2014-08-23 14:54 Kunda Note Added: 0033320
2014-10-22 05:51 Kunda Relationship added related to 0002371
2014-10-25 00:57 Kunda Patch => Yes
2015-01-30 00:24 Kunda Note Added: 0034396

Copyright © 2000 - 2015 MantisBT Team
Powered by Mantis Bugtracker