Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
4.0.0, 4.0.1
Description
I created a simple installer with a translated string test post.
all lines are translated except those in installscript.qs
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="ru_RU"> <context> <name>Page</name> <message> <source>Translations Example</source> <translation>Пример переводов</translation> </message> <message> <source>This is some text.</source> <translation>Это какой то текст</translation> </message> </context> <context> <name>installscript</name> <message> <source>This is a dynamically created page.</source> <translation>Это динамически созданная страница</translation> </message> </context> </TS>
installscript.qs
function Component() { // constructor component.loaded.connect(this, Component.prototype.loaded); installer.addWizardPage(component, "Page", QInstaller.TargetDirectory) } Component.prototype.createOperations = function() { try { // call the base create operations function component.createOperations(); } catch (e) { console.log(e); } } Component.prototype.loaded = function () { var page = gui.pageByObjectName("DynamicPage"); if (page != null) { page.entered.connect(Component.prototype.dynamicPageEntered); } } Component.prototype.dynamicPageEntered = function () { var pageWidget = gui.pageWidgetByObjectName("DynamicPage"); if (pageWidget != null) { pageWidget.m_pageLabel.text = qsTr("This is a dynamically created page."); } }
package.xml
<?xml version="1.0" encoding="UTF-8"?> <Package> <DisplayName>The root component</DisplayName> <Description>This component contains a license and translations to German.</Description> <Version>0.5.0-1</Version> <ReleaseDate>2015-01-29</ReleaseDate> <Licenses> <License name="Beer Public License Agreement" file="license.txt" /> </Licenses> <Default>true</Default> <Script>installscript.qs</Script> <UserInterfaces> <UserInterface>page.ui</UserInterface> </UserInterfaces> <Translations> <Translation>de.qm</Translation> <Translation>pl.qm</Translation> <Translation>ru.qm</Translation> </Translations> </Package>
For debugging of this bug see translations.tar.xz project. This project based on qt translations example.
Attachments
Issue Links
- duplicates
-
QTIFW-392 Translation of custom pages (.ui files) does not work
- Closed
- is required for
-
QTIFW-1906 Translation fixes
- Closed