[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: Re: Review Request 7106: AppStream support for l10n-script
From: "Chusslove Illich" <caslav.ilic () gmx ! net>
Date: 2014-05-01 14:26:43
Message-ID: 20140501142643.9431.79348 () probe ! kde ! org
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://svn.reviewboard.kde.org/r/7106/#review11107
-----------------------------------------------------------
itstool is putting the element path after the line number in the PO source comment, \
which is not valid PO format:
#: /tmp/tmp.md3YssnVWI:6(component/name)
msgid "Ark"
msgstr ""
I recall quite some time ago I discussed this with the author of itstool, but \
obviously fixing it wasn't made a priority. So could you Matthias add some \
post-itstool script to disentangle this? E.g. to produce:
#. element-path: component/name
#: /tmp/tmp.md3YssnVWI:6
msgid "Ark"
msgstr ""
Additionally, it would be useful to replace the temporary file name with the true \
file from which the string was extracted. If this is too hard, then the source file \
and line number should be simply removed, giving only:
#. element-path: component/name
msgid "Ark"
msgstr ""
- Chusslove Illich
On April 30, 2014, 8:13 a.m., Matthias Klumpp wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://svn.reviewboard.kde.org/r/7106/
> -----------------------------------------------------------
>
> (Updated April 30, 2014, 8:13 a.m.)
>
>
> Review request for Localization and Translation (l10n) and Albert Astals Cid.
>
>
> Repository: kde
>
>
> Description
> -------
>
> Hi!
> It's very difficult to extend the l10n-script if you don't know it's internal \
> workings, and if all comments are stripped out, so in order to get AppStream \
> support into the l10n-script, I created two small bash scripts to translate \
> AppStream upstream metadata:
> extract_metainfo.sh: This script generates .pot files from metadata
> XML files found in a project. Just cd to the directory you want the
> resulting pot files to be stored in, then call the script and point it
> at the project's source tree you want to be searched for the XML
> files.
>
> merge_metainfo.sh: The script merges translation back into the XML
> files. Simply cd to a directory which stores .mo files with the
> translated data and call the script with the project's source dir as
> first parameter.
>
> These scripts illustrate how translation of the XML can be done in
> KDE. I would kindly ask the l10n-script developers to take a look at
> it any maybe integrate it at the proper places, because they know the
> code way better than I do.
> The scripts can also be found at:
> http://people.freedesktop.org/~mak/appstream/kde-asmetadata-l10n.tar.gz
> (I also included a demo XML file there)
>
> If you have questions, please let me know!
> Cheers,
> Matthias
>
>
> Diffs
> -----
>
> trunk/l10n-kde4/scripts/extract_metainfo.sh PRE-CREATION
> trunk/l10n-kde4/scripts/as-metainfo.its PRE-CREATION
> trunk/l10n-kde4/scripts/update_translations 1384853
>
> Diff: https://svn.reviewboard.kde.org/r/7106/diff/
>
>
> Testing
> -------
>
> * Finds AppStream metadata in project source directories
> * .pot extraction works
> * Merging translation to untranslated files works
> * Merging new translation into already translated metadata files works (without \
> duplicating entries)
> * Resulting files are valid AppStream metadata files (compliance-check passed)
>
>
> Thanks,
>
> Matthias Klumpp
>
>
[Attachment #3 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://svn.reviewboard.kde.org/r/7106/">https://svn.reviewboard.kde.org/r/7106/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">itstool is putting the \
element path after the line number in the PO source comment, which is not valid PO \
format:
#: /tmp/tmp.md3YssnVWI:6(component/name)
msgid "Ark"
msgstr ""
I recall quite some time ago I discussed this with the author of itstool, but \
obviously fixing it wasn't made a priority. So could you Matthias add some \
post-itstool script to disentangle this? E.g. to produce:
#. element-path: component/name
#: /tmp/tmp.md3YssnVWI:6
msgid "Ark"
msgstr ""
Additionally, it would be useful to replace the temporary file name with the true \
file from which the string was extracted. If this is too hard, then the source file \
and line number should be simply removed, giving only:
#. element-path: component/name
msgid "Ark"
msgstr ""
</pre>
<br />
<p>- Chusslove Illich</p>
<br />
<p>On April 30th, 2014, 8:13 a.m. UTC, Matthias Klumpp wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://svn.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Localization and Translation (l10n) and Albert Astals \
Cid.</div> <div>By Matthias Klumpp.</div>
<p style="color: grey;"><i>Updated April 30, 2014, 8:13 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kde
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Hi! It's very difficult to extend the l10n-script if you don't \
know it's internal workings, and if all comments are stripped out, so in order to \
get AppStream support into the l10n-script, I created two small bash scripts to \
translate AppStream upstream metadata:
extract_metainfo.sh: This script generates .pot files from metadata
XML files found in a project. Just cd to the directory you want the
resulting pot files to be stored in, then call the script and point it
at the project's source tree you want to be searched for the XML
files.
merge_metainfo.sh: The script merges translation back into the XML
files. Simply cd to a directory which stores .mo files with the
translated data and call the script with the project's source dir as
first parameter.
These scripts illustrate how translation of the XML can be done in
KDE. I would kindly ask the l10n-script developers to take a look at
it any maybe integrate it at the proper places, because they know the
code way better than I do.
The scripts can also be found at:
http://people.freedesktop.org/~mak/appstream/kde-asmetadata-l10n.tar.gz
(I also included a demo XML file there)
If you have questions, please let me know!
Cheers,
Matthias
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">* Finds AppStream metadata in project source directories
* .pot extraction works
* Merging translation to untranslated files works
* Merging new translation into already translated metadata files works (without \
duplicating entries)
* Resulting files are valid AppStream metadata files (compliance-check passed)
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>trunk/l10n-kde4/scripts/extract_metainfo.sh <span style="color: \
grey">(PRE-CREATION)</span></li>
<li>trunk/l10n-kde4/scripts/as-metainfo.its <span style="color: \
grey">(PRE-CREATION)</span></li>
<li>trunk/l10n-kde4/scripts/update_translations <span style="color: \
grey">(1384853)</span></li>
</ul>
<p><a href="https://svn.reviewboard.kde.org/r/7106/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic