[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:       "Milian Wolff" <mail () milianw ! de>
Date:       2014-11-23 3:45:47
Message-ID: 20141123034547.22981.21227 () probe ! kde ! org
[Download RAW message or body]

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



> On Nov. 22, 2014, 2:40 p.m., Milian Wolff wrote:
> > Just some small nitpicks, ignore at all. I just looked at our desktop files and \
> > indeed, they contain the translated GenericName which is nowhere displayed. Same \
> > for kate and KPluginSelector in kcmutils. So getting rid of that sounds fine with \
> > me! A name + description is all I can think of that needs to be translated. 
> > thanks!

Looking at the current JSON files, they have contents such as this:

        {
            "KPlugin": {
                "Authors": [
                    {
                        "Email": "powerfox@kde.ru",
                        "Name": "Evgeniy Ivanov"
                    }
                ],
                "Category": "Version Control",
                "Name": "Git Support",
                "Name[bg]": "Поддръжка на Git",
                "Name[bs]": "Git podrška",
                ...
                "Description": "This plugin integrates Git to KDevelop",
                "Description[bg]": "Тaзи приставка вгражда Git в \
                KDevelop",
                "Description[bs]": "Ovaj dodatak integriše Git u KDevelop",
                ...
                "Icon": "git",
                "Id": "kdevgit",
                "License": "GPL",
                "ServiceTypes": [
                    "KDevelop/Plugin"
                ],
                "Version": "0.9"
            },
            "X-KDevelop-Category": "Global",
            "X-KDevelop-Mode": "GUI",
            "X-KDevelop-Interfaces": [
                "org.kdevelop.IBasicVersionControl", \
"org.kdevelop.IDistributedVersionControl"  ],
            "X-KDevelop-Version": "@KDEV_PLUGIN_VERSION@"
        }

I'm wondering whether we can somehow split out the translations? This will probably \
require some changes to `kservice`, but I'd be willing to do that. What I have in \
mind would be something like this:

        {
            "KPlugin": {
                "Authors": [
                    {
                        "Email": "powerfox@kde.ru",
                        "Name": "Evgeniy Ivanov"
                    }
                ],
                "Category": "Version Control",
                "Name": "Git Support",
                "Description": "This plugin integrates Git to KDevelop",
                "Icon": "git",
                "Id": "kdevgit",
                "License": "GPL",
                "ServiceTypes": [
                    "KDevelop/Plugin"
                ],
                "Version": "0.9"
            },
            "X-KDevelop-Category": "Global",
            "X-KDevelop-Mode": "GUI",
            "X-KDevelop-Interfaces": [
                "org.kdevelop.IBasicVersionControl", \
"org.kdevelop.IDistributedVersionControl"  ],
            "X-KDevelop-Version": "@KDEV_PLUGIN_VERSION@"
            
            "i18n": {
                "KPlugin": {
                    "Name": {
                        "bg": "Поддръжка на Git",
                        "bs": "Git podrška",
                        ...
                    },
                    "Description": {
                        "bg": "Тaзи приставка вгражда Git в \
KDevelop",  "bs": "Ovaj dodatak integriše Git u KDevelop",
                        ...
                    }
            }
        }

This way, it's also going to be much simpler for us to update the files afterwards. \
We just rip out the `i18n` entry and replace it with the current contents as read \
from the translated gettext resources. For me as a developer this is also much more \
convenient, as the translation "noise" is centralized at the end of the file and I \
can concentrate on the stuff above.

What do you think?


- Milian


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


On Nov. 21, 2014, 4 p.m., Burkhard Lück wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://svn.reviewboard.kde.org/r/7126/
> -----------------------------------------------------------
> 
> (Updated Nov. 21, 2014, 4 p.m.)
> 
> 
> Review request for Localization and Translation (l10n) and Milian Wolff.
> 
> 
> 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
> -----
> 
> trunk/l10n-kf5/scripts/create_json_files.sh PRE-CREATION 
> trunk/l10n-kf5/scripts/createjsoncontext.py PRE-CREATION 
> 
> 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
> 
> 


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





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On November 22nd, 2014, 2:40 p.m. UTC, <b>Milian \
Wolff</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="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;">Just some small nitpicks, ignore at all. I just looked \
at our desktop files and indeed, they contain the translated GenericName which is \
nowhere displayed. Same for kate and KPluginSelector in kcmutils. So getting rid of \
that sounds fine with me! A name + description is all I can think of that needs to be \
translated.</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">thanks!</p></pre>  </blockquote>







</blockquote>

<pre style="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;">Looking at the current JSON files, they have contents such as this:</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;"><div class="codehilite" style="background: #f8f8f8"><pre \
                style="line-height: 125%">    {
        <span style="color: #BA2121">&quot;KPlugin&quot;</span><span style="color: \
                #666666">:</span> {
            <span style="color: #BA2121">&quot;Authors&quot;</span><span \
style="color: #666666">:</span> [  {
                    <span style="color: #BA2121">&quot;Email&quot;</span><span \
style="color: #666666">:</span> <span style="color: \
#BA2121">&quot;powerfox@kde.ru&quot;</span>,  <span style="color: \
#BA2121">&quot;Name&quot;</span><span style="color: #666666">:</span> <span \
style="color: #BA2121">&quot;Evgeniy Ivanov&quot;</span>  }
            ],
            <span style="color: #BA2121">&quot;Category&quot;</span><span \
style="color: #666666">:</span> <span style="color: #BA2121">&quot;Version \
                Control&quot;</span>,
            <span style="color: #BA2121">&quot;Name&quot;</span><span style="color: \
#666666">:</span> <span style="color: #BA2121">&quot;Git Support&quot;</span>,  <span \
style="color: #BA2121">&quot;Name[bg]&quot;</span><span style="color: \
#666666">:</span> <span style="color: #BA2121">&quot;Поддръжка на \
Git&quot;</span>,  <span style="color: #BA2121">&quot;Name[bs]&quot;</span><span \
style="color: #666666">:</span> <span style="color: #BA2121">&quot;Git \
                podrška&quot;</span>,
            ...
            <span style="color: #BA2121">&quot;Description&quot;</span><span \
style="color: #666666">:</span> <span style="color: #BA2121">&quot;This plugin \
integrates Git to KDevelop&quot;</span>,  <span style="color: \
#BA2121">&quot;Description[bg]&quot;</span><span style="color: #666666">:</span> \
<span style="color: #BA2121">&quot;Тaзи приставка вгражда Git в \
KDevelop&quot;</span>,  <span style="color: \
#BA2121">&quot;Description[bs]&quot;</span><span style="color: #666666">:</span> \
<span style="color: #BA2121">&quot;Ovaj dodatak integriše Git u \
                KDevelop&quot;</span>,
            ...
            <span style="color: #BA2121">&quot;Icon&quot;</span><span style="color: \
                #666666">:</span> <span style="color: \
                #BA2121">&quot;git&quot;</span>,
            <span style="color: #BA2121">&quot;Id&quot;</span><span style="color: \
                #666666">:</span> <span style="color: \
                #BA2121">&quot;kdevgit&quot;</span>,
            <span style="color: #BA2121">&quot;License&quot;</span><span \
                style="color: #666666">:</span> <span style="color: \
                #BA2121">&quot;GPL&quot;</span>,
            <span style="color: #BA2121">&quot;ServiceTypes&quot;</span><span \
                style="color: #666666">:</span> [
                <span style="color: #BA2121">&quot;KDevelop/Plugin&quot;</span>
            ],
            <span style="color: #BA2121">&quot;Version&quot;</span><span \
style="color: #666666">:</span> <span style="color: #BA2121">&quot;0.9&quot;</span>  \
},  <span style="color: #BA2121">&quot;X-KDevelop-Category&quot;</span><span \
style="color: #666666">:</span> <span style="color: \
                #BA2121">&quot;Global&quot;</span>,
        <span style="color: #BA2121">&quot;X-KDevelop-Mode&quot;</span><span \
                style="color: #666666">:</span> <span style="color: \
                #BA2121">&quot;GUI&quot;</span>,
        <span style="color: #BA2121">&quot;X-KDevelop-Interfaces&quot;</span><span \
style="color: #666666">:</span> [  <span style="color: \
#BA2121">&quot;org.kdevelop.IBasicVersionControl&quot;</span>, <span style="color: \
#BA2121">&quot;org.kdevelop.IDistributedVersionControl&quot;</span>  ],
        <span style="color: #BA2121">&quot;X-KDevelop-Version&quot;</span><span \
style="color: #666666">:</span> <span style="color: \
#BA2121">&quot;@KDEV_PLUGIN_VERSION@&quot;</span>  }
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">I'm wondering whether we can somehow split out the \
translations? This will probably require some changes to <code style="text-rendering: \
inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">kservice</code>, but I'd be willing to do that. What I have in mind would \
be something like this:</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;"><div class="codehilite" \
                style="background: #f8f8f8"><pre style="line-height: 125%">    {
        <span style="color: #BA2121">&quot;KPlugin&quot;</span><span style="color: \
                #666666">:</span> {
            <span style="color: #BA2121">&quot;Authors&quot;</span><span \
style="color: #666666">:</span> [  {
                    <span style="color: #BA2121">&quot;Email&quot;</span><span \
style="color: #666666">:</span> <span style="color: \
#BA2121">&quot;powerfox@kde.ru&quot;</span>,  <span style="color: \
#BA2121">&quot;Name&quot;</span><span style="color: #666666">:</span> <span \
style="color: #BA2121">&quot;Evgeniy Ivanov&quot;</span>  }
            ],
            <span style="color: #BA2121">&quot;Category&quot;</span><span \
style="color: #666666">:</span> <span style="color: #BA2121">&quot;Version \
                Control&quot;</span>,
            <span style="color: #BA2121">&quot;Name&quot;</span><span style="color: \
#666666">:</span> <span style="color: #BA2121">&quot;Git Support&quot;</span>,  <span \
style="color: #BA2121">&quot;Description&quot;</span><span style="color: \
#666666">:</span> <span style="color: #BA2121">&quot;This plugin integrates Git to \
                KDevelop&quot;</span>,
            <span style="color: #BA2121">&quot;Icon&quot;</span><span style="color: \
                #666666">:</span> <span style="color: \
                #BA2121">&quot;git&quot;</span>,
            <span style="color: #BA2121">&quot;Id&quot;</span><span style="color: \
                #666666">:</span> <span style="color: \
                #BA2121">&quot;kdevgit&quot;</span>,
            <span style="color: #BA2121">&quot;License&quot;</span><span \
                style="color: #666666">:</span> <span style="color: \
                #BA2121">&quot;GPL&quot;</span>,
            <span style="color: #BA2121">&quot;ServiceTypes&quot;</span><span \
                style="color: #666666">:</span> [
                <span style="color: #BA2121">&quot;KDevelop/Plugin&quot;</span>
            ],
            <span style="color: #BA2121">&quot;Version&quot;</span><span \
style="color: #666666">:</span> <span style="color: #BA2121">&quot;0.9&quot;</span>  \
},  <span style="color: #BA2121">&quot;X-KDevelop-Category&quot;</span><span \
style="color: #666666">:</span> <span style="color: \
                #BA2121">&quot;Global&quot;</span>,
        <span style="color: #BA2121">&quot;X-KDevelop-Mode&quot;</span><span \
                style="color: #666666">:</span> <span style="color: \
                #BA2121">&quot;GUI&quot;</span>,
        <span style="color: #BA2121">&quot;X-KDevelop-Interfaces&quot;</span><span \
style="color: #666666">:</span> [  <span style="color: \
#BA2121">&quot;org.kdevelop.IBasicVersionControl&quot;</span>, <span style="color: \
#BA2121">&quot;org.kdevelop.IDistributedVersionControl&quot;</span>  ],
        <span style="color: #BA2121">&quot;X-KDevelop-Version&quot;</span><span \
style="color: #666666">:</span> <span style="color: \
#BA2121">&quot;@KDEV_PLUGIN_VERSION@&quot;</span>

        <span style="color: #BA2121">&quot;i18n&quot;</span><span style="color: \
                #666666">:</span> {
            <span style="color: #BA2121">&quot;KPlugin&quot;</span><span \
                style="color: #666666">:</span> {
                <span style="color: #BA2121">&quot;Name&quot;</span><span \
style="color: #666666">:</span> {  <span style="color: \
#BA2121">&quot;bg&quot;</span><span style="color: #666666">:</span> <span \
style="color: #BA2121">&quot;Поддръжка на Git&quot;</span>,  <span \
style="color: #BA2121">&quot;bs&quot;</span><span style="color: #666666">:</span> \
                <span style="color: #BA2121">&quot;Git podrška&quot;</span>,
                    ...
                },
                <span style="color: #BA2121">&quot;Description&quot;</span><span \
style="color: #666666">:</span> {  <span style="color: \
#BA2121">&quot;bg&quot;</span><span style="color: #666666">:</span> <span \
style="color: #BA2121">&quot;Тaзи приставка вгражда Git в \
KDevelop&quot;</span>,  <span style="color: #BA2121">&quot;bs&quot;</span><span \
style="color: #666666">:</span> <span style="color: #BA2121">&quot;Ovaj dodatak \
                integriše Git u KDevelop&quot;</span>,
                    ...
                }
        }
    }
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">This way, it's also going to be much simpler for us to \
update the files afterwards. We just rip out the <code style="text-rendering: \
inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">i18n</code> entry and replace it with the current contents as read from the \
translated gettext resources. For me as a developer this is also much more \
convenient, as the translation "noise" is centralized at the end of the file and I \
can concentrate on the stuff above.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">What do you \
think?</p></pre> <br />










<p>- Milian</p>


<br />
<p>On November 21st, 2014, 4 p.m. UTC, Burkhard Lück wrote:</p>









<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. 21, 2014, 4 p.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;"><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> </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>

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


--===============0756109748115932054==--


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

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