check_po script enhancements?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

check_po script enhancements?

Eero Tamminen-3
Hi,

The "check_po" script for translations is really nice.

I was wondering whether it should/could check also that translator is not
including the context part into translation (part before '|').  As the
context part is removed, translating also that is not in any way serious,
but the translator might have not understood the purpose of the context.

Maybe the script could output something like:
        redundant context part left into message 'X'
?

Is there something else that could be checked automatically from the
translations that's not yet being checked?

It might e.g. check & warn about the same thing that msgformat already does
i.e. that the msgstr ends with the same punctuation as msgid.


        - Eero


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: check_po script enhancements?

Alex Roitman
Eero,

On Wed, 2006-04-19 at 19:27 +0300, Eero Tamminen wrote:
> I was wondering whether it should/could check also that translator is not
> including the context part into translation (part before '|').  As the
> context part is removed, translating also that is not in any way serious,

Actually, translating the context is very serious. The "|" is only
removed *if* the msgid and msgstr are the same thing (e.g. no
translation). If they are not the same thing then the msgstr will
be outputed as is.

So the translated strings will not have "|" removed!

> but the translator might have not understood the purpose of the context.
> Maybe the script could output something like:
> redundant context part left into message 'X'
> ?

This sounds like a good idea. If this is detected, anybody
can go ahead and remove the "blah|" part without necessarily
knowing the language.

Alex

--
Alexander Roitman   http://www.gramps-project.org

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: check_po script enhancements?

Eero Tamminen-3
Hi,

On Wednesday 19 April 2006 19:17, Alex Roitman wrote:

> Actually, translating the context is very serious. The "|" is only
> removed *if* the msgid and msgstr are the same thing (e.g. no
> translation). If they are not the same thing then the msgstr will
> be outputed as is.
>
> So the translated strings will not have "|" removed!
>
> > but the translator might have not understood the purpose of the
> > context. Maybe the script could output something like:
> > redundant context part left into message 'X'
> > ?
>
> This sounds like a good idea. If this is detected, anybody
> can go ahead and remove the "blah|" part without necessarily
> knowing the language.

I think in this case it would be better to leave that to the translator
on the assumption that as he didn't know the purpose of the context,
the rest of the string might not be correctly translated either.


        - Eero


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Context part?

Stefan Björk
In reply to this post by Eero Tamminen-3
Hi,

> I was wondering whether it should/could check also that translator is not
> including the context part into translation (part before '|').  As the
> context part is removed, translating also that is not in any way serious,
> but the translator might have not understood the purpose of the context.

This was new to me. I didn't know what context parts was until now,
and I realize that I have screwed up the swedish translation. I will
fix that, and I also think that the check_po script should check for
this.

Not all translators are well aware of how .po-files really work. At
least, I'm not.

Stefan

--
Stefan Björk, student                http://www.acc.umu.se/~skalman/
Umeå Universitet                                      +46-70-6222437


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Context part?

Alex Roitman
Stefan,

On Fri, 2006-04-21 at 07:40 +0200, Stefan Björk wrote:

> > I was wondering whether it should/could check also that translator is not
> > including the context part into translation (part before '|').  As the
> > context part is removed, translating also that is not in any way serious,
> > but the translator might have not understood the purpose of the context.
>
> This was new to me. I didn't know what context parts was until now,
> and I realize that I have screwed up the swedish translation. I will
> fix that, and I also think that the check_po script should check for
> this.
>
> Not all translators are well aware of how .po-files really work. At
> least, I'm not.
For now, I have added this to our wiki page on translations:
   http://developers.gramps-project.org/tiki-index.php?page=TipsForTranslators

I'll see about tweaking check_po script,
Alex

--
Alexander Roitman   http://www.gramps-project.org

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: check_po script enhancements?

Alex Roitman
In reply to this post by Eero Tamminen-3
On Wed, 2006-04-19 at 19:27 +0300, Eero Tamminen wrote:
> I was wondering whether it should/could check also that translator is not
> including the context part into translation (part before '|').  As the
> context part is removed, translating also that is not in any way serious,
> but the translator might have not understood the purpose of the context.
>
> Maybe the script could output something like:
>     redundant context part left into message 'X'

This and other enhancements for check_po have been added to the CVS:

1. Fuzzy translations are excluded from all tests. A lot of false
   positives were produced by fuzzies that are not seen by the user.

2. Runaway context is being check and reported. The criterion for this
   test is as follows (all must be true):
      msgid has '|' char
      msgstr has '|' char,
      msgdir differs from msgstr.

3. The total and coverage stats are produced for PO file *and*
   for the template.po file. This is to detect the need for updating
   po-files from the template. For up-to-date po file the PO total
   and Template total will be the same.

Please feel free to run "./check_po filename.po" and correct your
translation. I'll try emailing the remaining problems to translators
after the weekend, if any still exist.

Alex

--
Alexander Roitman   http://www.gramps-project.org

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: check_po script enhancements?

Eero Tamminen-3
Hi,

On Saturday 22 April 2006 03:30, Alex Roitman wrote:

> > I was wondering whether it should/could check also that translator is
> > not including the context part into translation (part before '|').  As
> > the context part is removed, translating also that is not in any way
> > serious, but the translator might have not understood the purpose of
> > the context.
> >
> > Maybe the script could output something like:
> >     redundant context part left into message 'X'
>
> This and other enhancements for check_po have been added to the CVS:
>
> 1. Fuzzy translations are excluded from all tests. A lot of false
>    positives were produced by fuzzies that are not seen by the user.
>
> 2. Runaway context is being check and reported. The criterion for this
>    test is as follows (all must be true):
>       msgid has '|' char
>       msgstr has '|' char,
>       msgdir differs from msgstr.
Great, thanks!


> 3. The total and coverage stats are produced for PO file *and*
>    for the template.po file. This is to detect the need for updating
>    po-files from the template. For up-to-date po file the PO total
>    and Template total will be the same.

I think fuzzies should still be included into the PO total.  Currently the
code seems to give wrong impression that the po hasn't been merged although
it's only untranslated.  Attached is a patch to add fuzzy counting.


> Please feel free to run "./check_po filename.po" and correct your
> translation. I'll try emailing the remaining problems to translators
> after the weekend, if any still exist.

There seem to be a couple of (not very important) problems in the new
script:
- If I give check_po multiple PO files, I get following error:
----------
./check_po fi.po ru.po
...
Traceback (most recent call last):
  File "./check_po", line 193, in ?
    print "%s \t%5d \t%7d \t%7d \t%7d \t%7d \t%7d \t%3.2f%% \t%3.2f%%" %\
KeyError: 'fi.po'
----------
- For some reason check_po seems to count fi.po and sv.po messages wrong:
-----------
<~/work/gramps-devel/src/po> grep msgid template.po|wc
   2655   17044  118368
<~/work/gramps-devel/src/po> grep msgid fi.po|wc
   2655   17782  124247
<~/work/gramps-devel/src/po> grep msgstr fi.po|wc
   2655   13685  134862
<~/work/gramps-devel/src/po> grep msgstr template.po|wc
   2655    5310   26550
src/po> ./check_po fi.po
File:            fi.po
Template total:  2655
PO total:        2654
-----------
  I first thought it was because of the fuzzies, but there are no fuzzies
  and merging the template.pot again to fi.po doesn't change it at all.


        - Eero

check_po.diff (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: check_po script enhancements?

Alex Roitman
Eero,

On Sat, 2006-04-22 at 15:31 +0300, Eero Tamminen wrote:
> I think fuzzies should still be included into the PO total.  Currently the
> code seems to give wrong impression that the po hasn't been merged although
> it's only untranslated.  Attached is a patch to add fuzzy counting.

Applied and committed, thanks!

> > Please feel free to run "./check_po filename.po" and correct your
> > translation. I'll try emailing the remaining problems to translators
> > after the weekend, if any still exist.
>
> There seem to be a couple of (not very important) problems in the new
> script:
> - If I give check_po multiple PO files, I get following error:
> ----------
> ./check_po fi.po ru.po
> ...
> Traceback (most recent call last):
>   File "./check_po", line 193, in ?
>     print "%s \t%5d \t%7d \t%7d \t%7d \t%7d \t%7d \t%3.2f%% \t%3.2f%%" %\
> KeyError: 'fi.po'
Fixed in the CVS.

> ----------
> - For some reason check_po seems to count fi.po and sv.po messages wrong:
> -----------
> <~/work/gramps-devel/src/po> grep msgid template.po|wc
>    2655   17044  118368
> <~/work/gramps-devel/src/po> grep msgid fi.po|wc
>    2655   17782  124247
> <~/work/gramps-devel/src/po> grep msgstr fi.po|wc
>    2655   13685  134862
> <~/work/gramps-devel/src/po> grep msgstr template.po|wc
>    2655    5310   26550
> src/po> ./check_po fi.po
> File:            fi.po
> Template total:  2655
> PO total:        2654
> -----------
>   I first thought it was because of the fuzzies, but there are no fuzzies
>   and merging the template.pot again to fi.po doesn't change it at all.
This I haven't found the explanation for :-), at least not yet.
Alex

--
Alexander Roitman   http://www.gramps-project.org

signature.asc (196 bytes) Download Attachment