Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#3668 closed defect (fixed)

Clock has translation issues

Reported by: manuq Owned by: garycmartin
Priority: Unspecified by Maintainer Milestone:
Component: Clock Version: Git as of bugdate
Severity: Unspecified Keywords: 12.1.0
Cc: cjl, dsd Distribution/OS: Unspecified
Bug Status: Assigned

Description

At least the es.po file has commented out lines. I tried uncommenting them, and then did python setup.py build, and translations are back. Cjl commented in #3453:

For reference, Pootle's local copy of the POT was pushed back to Gitorious in December:

http://git.sugarlabs.org/clock/mainline/commit/30726bdba87892aa4a7a6e81dee2f199d0153e49

but the code changes that the potupdater script would have picked up happened earlier. Judging from the revised POT creation date in Nov, I guess.

"POT-Creation-Date: 2011-11-09 00:33-0500\n"

Change History (16)

comment:1 Changed 12 years ago by cjl

  • Cc cjl added

comment:2 follow-ups: Changed 12 years ago by cjl

Previously strings like

"Activity"
"Write Time"
"Write Date"
"Toolbar"
"Digital Clock"

were msgctxt comments. Frequently, the msgid was some sort of markup. Then at some point, these msgctxt comments were changed to the msgids. This changed happened in the code and, in due course, was reflected in POT and then PO files.

This obsoleted the former strings, causing them to be placed at the bottom of the PO file after #~ (PO file obsolete string comments).

comment:3 in reply to: ↑ 2 Changed 12 years ago by garycmartin

Replying to cjl:

Previously strings like

"Activity"
"Write Time"
"Write Date"
"Toolbar"
"Digital Clock"

were msgctxt comments. Frequently, the msgid was some sort of markup. Then at some point, these msgctxt comments were changed to the msgids. This changed happened in the code and, in due course, was reflected in POT and then PO files.

This obsoleted the former strings, causing them to be placed at the bottom of the PO file after #~ (PO file obsolete string comments).

So the only two code changes associated to these strings in the source code were 29th May 2011 commit 8be037 "Pep8 cleanup (patch from manuq)", and then again on 4th Oct 2011 commit b39c34 "Use _ instead of _p for marking reanslatable strings SL#1658"

comment:4 Changed 12 years ago by garycmartin

timewriter.py msgid "time(h, m) => What Time Is It?" is the specific one I was worried about, it's the set of rules that generated the printed and spoken text in the correct language. Looking at en.po, fr.po and es.po the strings look good apart from at least two Spanish typos:

{{
" number(43) => cuatenta y tres |\n"
" number(44) => curatenta y cuatro |\n"
}}

Should (I think, and google at least agreed) be:

{{
" number(43) => cuarenta y tres |\n"
" number(44) => cuarenta y cuatro |\n"
}}

I'm currently going back over the other UI text hints/strings to check what's going on there...

comment:5 follow-up: Changed 12 years ago by cjl

I fixed those two string typos in the es.po and resubmitted.

comment:6 in reply to: ↑ 5 Changed 12 years ago by garycmartin

Replying to cjl:

I fixed those two string typos in the es.po and resubmitted.

Fab thanks, sorry one more. A friend (linguist) just passed a quick eye over the file, she pointed out the spelling of trenta should be treinta in the below lines:

"         number(30) => trenta |\n"
"         number(31) => trenta y uno |\n"
"         number(32) => trenta y dos |\n"
"         number(33) => trenta y tres |\n"
"         number(34) => trenta y cuatro |\n"
"         number(35) => trenta y cinco |\n"
"         number(36) => trenta y seis |\n"
"         number(37) => trenta y siete |\n"
"         number(38) => trenta y ocho |\n"
"         number(39) => trenta y nueve |\n"

comment:8 in reply to: ↑ 2 Changed 12 years ago by garycmartin

Replying to cjl:

Previously strings like

"Activity"
"Write Time"
"Write Date"
"Toolbar"
"Digital Clock"

Looks like these are all related to having extra context, the context 'Toolbar' is used for a number of the strings, seems like only the first one is getting into the generated .pot file. Tracing back through git, this happened in December 1st 2011 with commit 30726b. Wondering if this is a bug or change with current gettext. When I run ./setup genpot locally, it seems to have the same behaviour, perhaps the pot file was being manually edited before and genpot never worked:

#: clock.py:232 clock.py:263 clock.py:269 clock.py:275 clock.py:289
#: clock.py:295 clock.py:306
msgid "Toolbar"
msgstr ""

were msgctxt comments. Frequently, the msgid was some sort of markup. Then at some point, these msgctxt comments were changed to the msgids. This changed happened in the code and, in due course, was reflected in POT and then PO files.

This obsoleted the former strings, causing them to be placed at the bottom of the PO file after #~ (PO file obsolete string comments).

comment:9 Changed 12 years ago by garycmartin

clock.py is using pgettext for its strings so that extra context text is provided to the translator, this appears to be broken somewhere in the workflow as the context is ending up as the msgid and the actual string for translation is left out (it's treating the strings like gettext rather than pgettext).

from pgettext import pgettext as _

v.s. timewrite.py that is using the more common:

from gettext import gettext as _

I'm going to try and replace the use of pgettext, and remove all the context strings from clock.py, I'm fairly sure there is no real disambiguation needed in clock.py, but this is going to trigger a cascade of string fixed needed in pootle, sorry cjl!

comment:10 follow-up: Changed 12 years ago by erikos

  • Bug Status changed from Unconfirmed to Assigned

Hi Gary,

you might be interested in that:

http://git.sugarlabs.org/sugar-toolkit/mainline/blobs/master/src/sugar/activity/i18n.py#line96

from sugar.activity.i18n import pgettext
pgettext('Clipboard', 'Remove')

Is what we use for example in the Sugar shell.

HTH

comment:11 in reply to: ↑ 10 Changed 12 years ago by garycmartin

Replying to erikos:

Hi Gary,

you might be interested in that:

http://git.sugarlabs.org/sugar-toolkit/mainline/blobs/master/src/sugar/activity/i18n.py#line96

from sugar.activity.i18n import pgettext
pgettext('Clipboard', 'Remove')

Is what we use for example in the Sugar shell.

HTH

Fab, thanks for the heads up, had missed this. I'm very tempted to do some re-testing with it but it would break Clock for anyone using Sugar older than 0.92.0. Will need to see how much pootle pain my (somewhat invasive) patch of last night causes, commit 8b9af0.

comment:12 follow-up: Changed 12 years ago by cjl

Close as fixed yet?

comment:13 in reply to: ↑ 12 Changed 12 years ago by garycmartin

Replying to cjl:

Close as fixed yet?

Thanks for the ping, yes I'm happy this one is also resolved with all our work yesterday, but would be good if manuq could give a quick check of Clock-9 and close if he is happy.

comment:14 Changed 12 years ago by manuq

  • Cc dsd added

Thanks for your effort! I checked Clock 9 and the translations are correct now. Daniel, please add to build.

comment:15 Changed 12 years ago by manuq

  • Resolution set to fixed
  • Status changed from new to closed

comment:16 Changed 11 years ago by dnarvaez

  • Milestone 0.96 deleted

Milestone 0.96 deleted

Note: See TracTickets for help on using tickets.