[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Review Request 7126: message extraction of json files for scripty
From:       Burkhard_Lück <lueck () hube-lueck ! de>
Date:       2014-11-24 16:31:54
Message-ID: 20141124163154.11308.14057 () probe ! kde ! org
[Download RAW message or body]

--===============3784948081351236232==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://svn.reviewboard.kde.org/r/7126/
-----------------------------------------------------------

(Updated Nov. 24, 2014, 4:31 nachm.)


Review request for Localization and Translation (l10n) and Milian Wolff.


Changes
-------

* add python script filljsonfrompo.py to merge translations back to the json files as \
                requested by Albert
* integrate json template extraction into update_translations
* add the call of filljsonfrompo.py for merging translation back into json in \
create_json_files.sh

running a manual roundtrip for the repo kdevplatform with a /plugins/git/kdevgit.json
1) create a template json_kdevplatform.pot
2) translate this in x-test + de and put the po's into the correct lang dir in \
l10n-kf5 3) run filljsonfrompo.py with proper args
generates this kdevgit.json:
{
    "KPlugin": {
        "Authors": [
            {
                "Email": "powerfox@kde.ru", 
                "Name": "Evgeniy Ivanov"
            }
        ], 
        "Category": "Version Control", 
        "Description": "This plugin integrates Git to KDevelop", 
        "Description[de]": "deThis plugin integrates Git to KDevelopde", 
        "Description[x-test]": "xxThis plugin integrates Git to KDevelopxx", 
        "Icon": "git", 
        "Id": "kdevgit", 
        "License": "GPL", 
        "Name": "Git Support", 
        "Name[de]": "deGit Supportde", 
        "Name[x-test]": "xxGit Supportxx", 
        "ServiceTypes": [
            "KDevelop/Plugin"
        ], 
        "Version": "0.9"
    }, 
    "X-KDevelop-Category": "Global", 
    "X-KDevelop-Interfaces": [
        "org.kdevelop.IBasicVersionControl", 
        "org.kdevelop.IDistributedVersionControl"
    ], 
    "X-KDevelop-Mode": "GUI"
}
Because I have translations of the fields only in two languages de+x-test all other \
translations are stripped  of and the changed translations from de are merged back \
into the json file.


Repository: kde


Description
-------

createjsoncontext.py extracts the fields KPlugin.Name and KPlugin.Description from \
all json files in a repo into a gettext template (has to be postprocessed to be \
valid)

Only the field name is used as msgctxt as we do it with desktop files

Question is which fields we need/want to support here.
desktop files have Language, Keywords, X-KDE-Keywords, About, Description, Query, 
ExtraNames, X-KDE-Submenu as translatable fields

But from the plugins desktop/json files in kdevelop afaik only Name + Description \
(=Comment in desktop) are used in the GUI.

create_json_files.sh is a modified/stripped down copy of create_desktop_files.sh and \
has to be adapted  for $mod with unterscores


Diffs (updated)
-----

  trunk/l10n-kf5/scripts/create_json_files.sh PRE-CREATION 
  trunk/l10n-kf5/scripts/createjsoncontext.py PRE-CREATION 
  trunk/l10n-kf5/scripts/filljsonfrompo.py PRE-CREATION 
  trunk/l10n-kf5/scripts/update_translations 1407213 

Diff: https://svn.reviewboard.kde.org/r/7126/diff/


Testing
-------

Manually running 
l10n-kf5/scripts$ python createjsoncontext.py $(find \
../../extragear/build/kdevelop_kdevplatform/ -name *.json) ../../extragear/build/ \
generates a gettext template which needs to be processed further by \
create_json_files.sh  to get rid of some duplicate messages.


Thanks,

Burkhard Lück


--===============3784948081351236232==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://svn.reviewboard.kde.org/r/7126/">https://svn.reviewboard.kde.org/r/7126/</a>
  </td>
    </tr>
   </table>
   <br />





<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for Localization and Translation (l10n) and Milian Wolff.</div>
<div>By Burkhard Lück.</div>


<p style="color: grey;"><i>Updated Nov. 24, 2014, 4:31 nachm.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">* add python script filljsonfrompo.py to merge translations back to the \
                json files as requested by Albert
* integrate json template extraction into update_translations
* add the call of filljsonfrompo.py for merging translation back into json in \
create_json_files.sh

running a manual roundtrip for the repo kdevplatform with a /plugins/git/kdevgit.json
1) create a template json_kdevplatform.pot
2) translate this in x-test + de and put the po&#39;s into the correct lang dir in \
l10n-kf5 3) run filljsonfrompo.py with proper args
generates this kdevgit.json:
{
    &quot;KPlugin&quot;: {
        &quot;Authors&quot;: [
            {
                &quot;Email&quot;: &quot;powerfox@kde.ru&quot;, 
                &quot;Name&quot;: &quot;Evgeniy Ivanov&quot;
            }
        ], 
        &quot;Category&quot;: &quot;Version Control&quot;, 
        &quot;Description&quot;: &quot;This plugin integrates Git to KDevelop&quot;, 
        &quot;Description[de]&quot;: &quot;deThis plugin integrates Git to \
                KDevelopde&quot;, 
        &quot;Description[x-test]&quot;: &quot;xxThis plugin integrates Git to \
KDevelopxx&quot;,   &quot;Icon&quot;: &quot;git&quot;, 
        &quot;Id&quot;: &quot;kdevgit&quot;, 
        &quot;License&quot;: &quot;GPL&quot;, 
        &quot;Name&quot;: &quot;Git Support&quot;, 
        &quot;Name[de]&quot;: &quot;deGit Supportde&quot;, 
        &quot;Name[x-test]&quot;: &quot;xxGit Supportxx&quot;, 
        &quot;ServiceTypes&quot;: [
            &quot;KDevelop/Plugin&quot;
        ], 
        &quot;Version&quot;: &quot;0.9&quot;
    }, 
    &quot;X-KDevelop-Category&quot;: &quot;Global&quot;, 
    &quot;X-KDevelop-Interfaces&quot;: [
        &quot;org.kdevelop.IBasicVersionControl&quot;, 
        &quot;org.kdevelop.IDistributedVersionControl&quot;
    ], 
    &quot;X-KDevelop-Mode&quot;: &quot;GUI&quot;
}
Because I have translations of the fields only in two languages de+x-test all other \
translations are stripped  of and the changed translations from de are merged back \
into the json file. </pre>
  </td>
 </tr>
</table>







<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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">createjsoncontext.py extracts the fields KPlugin.Name \
and KPlugin.Description from all json files in a repo into a gettext template (has to \
be postprocessed to be valid)</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">Only the field name is \
used as msgctxt as we do it with desktop files</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Question is which fields we need/want to support here. desktop files have \
Language, Keywords, X-KDE-Keywords, About, Description, Query,  ExtraNames, \
X-KDE-Submenu as translatable fields</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">But from the plugins \
desktop/json files in kdevelop afaik only Name + Description (=Comment in desktop) \
are used in the GUI.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">create_json_files.sh is a \
modified/stripped down copy of create_desktop_files.sh and has to be adapted  for \
$mod with unterscores</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Manually running  l10n-kf5/scripts$ python \
createjsoncontext.py $(find ../../extragear/build/kdevelop_kdevplatform/ -name \
*.json) ../../extragear/build/ generates a gettext template which needs to be \
processed further by create_json_files.sh  to get rid of some duplicate \
messages.</p></pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> \
(updated)</h1> <ul style="margin-left: 3em; padding-left: 0;">

 <li>trunk/l10n-kf5/scripts/create_json_files.sh <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/l10n-kf5/scripts/createjsoncontext.py <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/l10n-kf5/scripts/filljsonfrompo.py <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>trunk/l10n-kf5/scripts/update_translations <span style="color: \
grey">(1407213)</span></li>

</ul>

<p><a href="https://svn.reviewboard.kde.org/r/7126/diff/" style="margin-left: \
3em;">View Diff</a></p>






  </td>
 </tr>
</table>




  </div>
 </body>
</html>


--===============3784948081351236232==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic