Review Request 113218: Enable translation functions for js script loaded through Kross

Luigi Toscano luigi.toscano at tiscali.it
Mon Oct 14 22:28:27 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113218/
-----------------------------------------------------------

(Updated Oct. 14, 2013, 9:28 p.m.)


Status
------

This change has been marked as submitted.


Review request for kdelibs.


Repository: kdelibs


Description
-------

Bit of background: Account Wizard in kmail uses few js/es scripts (QScriptEngine) which are loaded using Kross. They expose one string each (but there could potentially more strings) which are visibile in the user interface but not translated. See for example:

https://projects.kde.org/projects/kde/kdepim-runtime/repository/revisions/master/entry/resources/imap/wizard/imapwizard.es#L24

QScriptEngine supports functions using functions like qsTr:
http://qt-project.org/doc/qt-4.8/scripting.html#internationalization
but the engine should be initialized, otherwise they are not recognized. The patch addresses this problem.

I think this is a bugfix which should go into Platform 4.11.

Frameworks: currently Kross uses QScriptEngine, so this should be easily merged there (I didn't try). If QScriptEngine is replace by QJSEngine, this issue should be addressed as well; a brief check in the documentation does not show any installTranslatorFunctions() method, but maybe the translation functions are now always exposed in the JS engine.


Diffs
-----

  kross/qts/script.cpp 41d46b2 
  kross/qts/main.cpp 041c306 

Diff: http://git.reviewboard.kde.org/r/113218/diff/


Testing
-------

It compiles, and qsTr is recognized when loading the scripts in kmail.


Thanks,

Luigi Toscano

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20131014/20a637c0/attachment.htm>


More information about the kde-core-devel mailing list