[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 (example)
From:       "Matthias Klumpp" <matthias () tenstral ! net>
Date:       2014-04-22 0:50:53
Message-ID: 20140422005053.3535.76063 () 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/
-----------------------------------------------------------

(Updated April 22, 2014, 12:50 a.m.)


Review request for Localization and Translation (l10n).


Repository: kde


Description (updated)
-------

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/its/as-metainfo.its PRE-CREATION 
  trunk/l10n-kde4/scripts/merge_metainfo.sh PRE-CREATION 

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 />




<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).</div>
<div>By Matthias Klumpp.</div>


<p style="color: grey;"><i>Updated April 22, 2014, 12:50 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  \
(updated)</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&#39;s very difficult to extend the l10n-script if you don&#39;t \
know it&#39;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&#39;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&#39;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/its/as-metainfo.its <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/l10n-kde4/scripts/merge_metainfo.sh <span style="color: \
grey">(PRE-CREATION)</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