Migrating Pology to Python 3
Adrian Chaves
adrian at chaves.io
Sat Oct 8 16:11:59 BST 2022
This is caused by
https://kingant.net/2019/01/rounding-numbers-in-python-2-and-python-3/
When plural forms are found, the average is calculated and rounded. In
Python 2, round(2.5) is 3, in Python 3 round(2.5) is 2.
I have no strong opinion on the matter, but I am slightly inclined to
keep the Python 3 behavior on this.
On 2022-10-08 13:31, Adrian Chaves wrote:
> I think the number of characters may be OK. Before it must have been
> counting bytes, i.e. counting `É` as 2.
>
> I will look into the word counting.
>
> On 2022-10-08 13:13, Karl Ove Hufthammer wrote:
> Adrian Chaves skreiv 04.10.2022 12:49:
> So I would like every Pology user to test as soon as possible their
> usual workflows with pology with the python3 branch, and report to me
> any issue. I do expect there to be issues. So send me a command to
> reproduce the issue you get, and I will fix it.
>
> This is a minor bug, posieve stats seems to count the number of words
> and characters in a different way now. Example:
>
> msgid "One Selected File"
> msgid_plural "%1 Selected Files"
> msgstr[0] "Éi merkt fil"
> msgstr[1] "%1 merkte filer"
>
> Python 2 'posieve stats' reports:
>
> - msgmsg/totw-orw/tot-orw-trch-orch-tr
> translated 1 100.0% 3 100.0% 3 14 11
>
> In other words, three English words (w-or) and 14 English characters
> (ch-or).
>
> While Python 3 'posieve stats' reports:
>
> - msgmsg/totw-orw/tot-orw-trch-orch-tr
> translated 1 100.0% 2 100.0% 2 14 10
>
> So 2 English words instead of 3, but the same number of English
> characters (14). However, for the translations, the number of
> characters also shrink, from 11 to 10 (and the number of words from 3
> to 2).
>
> I think both statistics are wrong. There are clearly 5 (or 6) English
> words.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-i18n-doc/attachments/20221008/995780f1/attachment.htm>
More information about the kde-i18n-doc
mailing list