I used lrelease command to create the .qm file from .ts file. However, only few of the words get translated when I change the language.
The funny part is one of the strings gets translated at one place and does not at the other. What could be wrong?
Are you sure that your .ts file is formatted as this?
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="it_IT">
<context>
<name>CustomDialogItems</name>
<message>
<location filename="../assets/CustomDialogItems.qml" line="39"/>
<location filename="../assets/CustomDialogItems.qml" line="58"/>
<source>Max Number of items</source>
<translation type="unfinished">Numero Massimo di Voci</translation>
</message>
<message>
<location filename="../assets/CustomDialogItems.qml" line="100"/>
<source>Cancel</source>
<translation type="unfinished">Cancella</translation>
</message>
<message>
<location filename="../assets/CustomDialogItems.qml" line="109"/>
<source>Set</source>
<translation type="unfinished">Imposta</translation>
</message>
</context>
</TS>
If you see type="obsolete" it means that the translation is no longer used.
However I've seen that some words are automatically translated if they are the texts of common actions, like dismissAction or shareAction. But you can force the translation adding 'text' property.
Related
I am consuming a web service that answers the xml:
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns0:getStatusCdrResponse xmlns:ns0="http://service.sunat.gob.pe">
<statusCdr>
<content>UEsDBBQACAgIABqiRFUAAAAAAAAAAAAAAAAiAAAAUi0yMDU1NDA2MDQ5OS0wMS1GMDA1LTAwMDAwMDc2LnhtbLVZW3OqShZ+n19h5TxmJ1wU1FSSqW5uooByVah5QUBEuQko6K+fRqMx+2TX7D01kzykWevrdfnWopvuvP6zSeLOISjKKEvfHohn/KETpF7mR2n49mAa/NPg4Z/v/3h1ixeQ53HkuRUCakGZZ2kZdNDktHx72BfpS+aWUfmSuklQvpR54EWrD/DLfhm/lN46SNyXpvRfxPSQRV7wRD5cpr+4xR9a+CaST2tBU/2hOSZLkizlmipIWxbQIzIZpFX5adRbev+VUYjg3rcG3f/OIAjDIgjdKvjOqI9Ksa6q/AXD6rp+rrvPWRFiJI7jGD7EEMYvo/CvK7rM3PyGvzgqn5GqlZ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LAQIUABQACAgIABqiRFULXKn9jg0AAMAaAAAiAAAAAAAAAAAAAAAAAAAAAABSLTIwNTU0MDYwNDk5LTAxLUYwMDUtMDAwMDAwNzYueG1sUEsFBgAAAAABAAEAUAAAAN4NAAAAAA==</content>
<statusCode>0004</statusCode>
<statusMessage>La constancia existe</statusMessage>
</statusCdr>
</ns0:getStatusCdrResponse>
</S:Body>
</S:Envelope>
The <content> is supposed to be a ZIP file, unfortunately I have no idea how to convert those characters to a ZIP, any suggestions on windev options I can use.
Use WINDEV 21.
Greetings.
Try to decode "content" to file.
bufZip is buffer = Decode(content,encodeBASE64)
fsavebuffer("c:\your folder\file.zip",bufZip)
In a similar way to what is done here, I would like to xmlpoke connectionString from an sqlmap.config file:
<?xml version="1.0" encoding="utf-8" ?>
<sqlMapConfig
xmlns="http://ibatis.apache.org/dataMapper"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<database>
<provider name="oracleClient1.0"/>
<dataSource name="DSExtranetAdherent"
connectionString="Data Source=MyInstance;User ID=MyUser;Password=MyPwd;Unicode=True;"/>
</database>
</sqlMapConfig>
I tried with this poke:
<xmlpoke
file="${ConfigPath}\sqlmap.config"
xpath="/sqlMapConfig/database/dataSource/#connectionString"
value="${ConnectionString}" />
But I get an error message:
[xmlpoke] No matching nodes were found with XPath expression '/sqlMapConfig/database/dataSource/#connectionString'.
The xpath is effective when I remove the xmlns property, but then I get this runtime error:
Unable to load file via resource "SqlMap.config" as resource.
Any idea on how to fix this xmlpoke with a good xpath?
xmlns is the default namespace, xmlpoke require a prefix for xpath parsing:
<xmlpoke
file="${ConfigPath}\sqlmap.config"
xpath="/iba:sqlMapConfig/iba:database/iba:dataSource/#connectionString"
value="${ConnectionString}">
<namespaces>
<namespace prefix="iba" uri="http://ibatis.apache.org/dataMapper" />
</namespaces>
</xmlpoke>
You should specify the <namespaces> child node for the <xmlpoke> task:
<namespaces>
<namespace prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance" />
</namespaces>
The last sample on this page explains just your case.
My requirement is to generate one XML file and few HTML files in the secondary port. I have configured few steps in XProc.
Here’s the sample code:
<p:xslt name="create-document">
<p:input port="stylesheet">
<p:document href="stylesheet.xsl" />
</p:input>
</p:xslt>
<p:for-each>
<p:iteration-source>
<p:pipe step="create-document" port="secondary" />
</p:iteration-source>
<p:store>
<p:with-option name="doctype-public" select="'-//W3C//DTD XHTML 1.0 Frameset//EN'" />
<p:with-option name="doctype-system" select="'http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd'" />
<p:with-option name="encoding" select="'UTF-8'" />
<p:with-option name="media-type" select="'text/html'" />
<p:with-option name="method" select="'xhtml'" />
<p:with-option name="omit-xml-declaration" select="'no'" />
</p:store>
</p:for-each>
The problem here is HTML file is generated properly. And the XML file is generated, but I am not able to view the XML content. Instead it displays everything in HTML format.This is because of <p:store> in the above code snippet.
How do you have two <p:store> steps? (One for HTML and the other for XML)
It would be nice if you could somehow determine with which xsl:result-document parameters each document on the secondary output was written. You would be able to duplicate those for your p:store. But you can derive other things from each document. You can retrieve the document name using base-uri(), and you can look at for instance the root element. You can put these values in a variable using:
<p:variable name="path" select="base-uri(/*)"/>
<p:variable name="root" select="local-name(/*)"/>
(Put these just below the p:iteration-source.)
You then need to decide how to call p:store. You could use XPath if, provided your XProc parser supports XPath 2.0 (like XMLCalabash does). But I’d recommend using a p:choose like this:
<p:choose>
<p:when test="ends-with($path, '.xhtml')">
<p:store
doctype-public="-//W3C//DTD XHTML 1.0 Frameset//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
encoding="UTF-8"
media-type="text/html"
method="xhtml"
omit-xml-declaration="no">
<p:with-option name="href" select="$path"/>
</p:store>
</p:when>
<p:otherwise>
<p:store
encoding="UTF-8"
media-type="application/xml"
method="xml"
omit-xml-declaration="no">
<p:with-option name="href" select="$path"/>
</p:store>
</p:otherwise>
</p:choose>
(This entire p:choose replaces the p:store you already have.)
The test in p:when only looks at $path, but you could include a test for $root as well, if you like.
It also requires you to use .xhtml as extension in your xsl:result-document statements for the HTML output, but you can easily tweak that if you like.
The var and the choose should be enough to get your XML written properly, at least.
Good luck!
I've seen a number of examples, e.g. here, where people are including locale resource bundles by referencing the locale attribute in the element. For some reason this doesn't work for me. Here's what I have for the task:
<compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US">
<source-path path-element="${basedir}/src/main/flex"/>
<include-sources dir="${basedir}/src/main/flex" includes="*" />
<include-libraries file="${basedir}/libs"/>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/9" append="true">
<include name="playerglobal.swc"/>
</compiler.external-library-path>
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs"/>
<include name="locale/${locale}"/>
</compiler.library-path>
<load-config filename="${basedir}/fb3config.xml" />
</compc>
This fails with a bunch of errors of the form:
[compc] Error: could not find source for resource bundle ...
I can make it build with this one change:
<include name="locale/en_US"/>
The configuration file generated by Flex Builder 3 actually renders this as "locale/{locale}" (notice the $ is missing). I've tried that as well with the same (failing) results.
For now, I'm doing OK directly injecting en_US as we won't be doing localization bundles for quite some time, but I will eventually need to get this working. Also, it bugs me that I can't make it work the way that it SHOULD work!
I think the problem here is that ${locale} is interpreted by ant as a property, rather than a string literal to pass to the compc task. What I mean is that ant sees ${locale} and thinks that you want to substitute the value of the property locale which is (supposedly) defined in your build file. Of course, this isn't what you want at all, and things break miserably because of it.
The way I've done things in my build files is to remove the $ prefix and everything seems to work as expected. So your example would look something like this:
<compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US">
<source-path path-element="${basedir}/src/main/flex"/>
<include-sources dir="${basedir}/src/main/flex" includes="*" />
<include-libraries file="${basedir}/libs"/>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/9" append="true">
<include name="playerglobal.swc"/>
</compiler.external-library-path>
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs"/>
<!-- Ditch the dollar sign and things should work! -->
<include name="locale/{locale}"/>
</compiler.library-path>
<load-config filename="${basedir}/fb3config.xml" />
</compc>
I'm trying to compile an SWC file from a list of given ActionScript classes. I'm using the compc compiler. The problem is that there are so many classes grouped into multiple namespaces that I am finding it very tedious to specify each individual class to be included in the SWC. Is there any easier way of doing this like just simply specifying a root directory of these classes?
At the moment I have something like this:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>C:\SomeFolder\testSWC.swc</output>
<compiler>
<source-path>.</source-path>
</compiler>
<include-classes>
<class>SomeNamespaceOne.One</class>
<class>SomeNamespaceOne.Two</class>
<class>SomeNamespaceOne.Three</class>
<class>SomeNamespaceOne.Four</class>
...
<class>SomeNamespaceFifty.One</class>
</include-classes>
</flex-config>
But I want something like this:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>C:\SomeFolder\testSWC.swc</output>
<compiler>
<source-path>. </source-path>
</compiler>
<include-classes>
<class>SomeRootDirectoryOfClassesToCompile</class>
</include-classes>
</flex-config>
Is this possible?
We wanted something similar, in "Ant".
I am assuming you are not using Flex Builder. In that case, I will definitely recommend using Ant and Flex Ant tasks available from Adobe. Even when you use Ant, its not easy doing what you want to do, so I am including our code below.
Following is our code. I don't remember where I got the idea from, so cannot thank the source for it :)
<pathconvert property="XXX.classes" pathsep=" ">
<fileset dir="${basedir}/XXX/src">
<include name="**/*.as"/>
<include name="**/*.mxml"/>
</fileset>
<compositemapper>
<packagemapper from="${basedir}\XXX\src\*.as" to="*"/>
<packagemapper from="${basedir}/XXX/src/*.as" to="*"/>
<packagemapper from="${basedir}\XXX\src\*.mxml" to="*"/>
<packagemapper from="${basedir}/XXX/src/*.mxml" to="*"/>
</compositemapper>
</pathconvert>
<compc optimize="true" debug="false"
include-classes="${XXX.classes}" output="${BUILD_FOLDER}/XXX.swc">
</compc>
Like Tanmay said, you should use the ANT tasks to make life easier, but there's an even simpler wach include an entire directory in the compc ant task. If you just need to include everything in src.dir you can do it like this:
<compc output="${target.dir}/foo.swc">
<source-path path-element="${src.dir}"/>
<include-sources dir="${src.dir}">
<include name="**/*" />
</include-sources>
</compc>