Edgewall Software

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#299 closed defect (fixed)

i18n:msg wrongly extracted twice, as a whole and by pieces

Reported by: cboos Owned by: palgarvio
Priority: critical Milestone: 0.6
Component: Internationalization Version: devel
Keywords: i18n:msg Cc:

Description

Feel free to adjust the summary...

What happens is that a given element with i18n:msg attribute gets extracted twice in the resulting catalog template.

See changeset:8106#file2 for the .html source and changeset:8106#file1 for the .pot file.

This is seen with the advanced-i18n branch 0.6dev-r1028 and older revisions up to the beginning of the branch.

It should be noted that Genshi trunk successfully extracts only the whole content. Here's a diff based on trac:source:trunk/trac/locale/messages.pot@8106 after running a python setup.py extract_messages using Genshi trunk (r1052):

  • trac/locale/messages.pot

     
    27232723msgstr ""
    27242724
    27252725#: trac/ticket/templates/ticket.html:128
    2726 msgid "Opened"
    2727 msgstr ""
    2728 
    2729 #: trac/ticket/templates/ticket.html:128 trac/ticket/templates/ticket.html:129
    2730 msgid "ago"
    2731 msgstr ""
    2732 
    2733 #: trac/ticket/templates/ticket.html:128
    27342726#, python-format
    27352727msgid "Opened %(created)s ago"
    27362728msgstr ""
    27372729
    27382730#: trac/ticket/templates/ticket.html:129
    2739 msgid "Last modified"
    2740 msgstr ""
    2741 
    2742 #: trac/ticket/templates/ticket.html:129
    27432731#, python-format
    27442732msgid "Last modified %(modified)s ago"
    27452733msgstr ""

Change History (7)

comment:1 Changed 15 years ago by cboos

[T8108] exhibits the same issue with double extraction (I've filled the unwanted translations with "IGNORE: partial extraction - see below").

I've also noticed another issue with this translation which I'm not sure is related (it looks rather like #278, which I'll reopen in a minute).

comment:2 follow-up: Changed 15 years ago by cboos

  • Priority changed from major to critical

Well, for some reason I assumed that regardless of the double extraction, the correct whole string was used at rendering time.

Apparently, the one which gets picked depends on the order within the compiled catalog, as I now see the following in my error page:

IGNORE: partial extraction - see below IGNORE: partial extraction - see below IGNORE: partial extraction - see belowIGNORE: partial extraction - see below IGNORE: partial extraction - see below IGNORE: partial extraction - see below

Not good...

comment:3 in reply to: ↑ 2 Changed 15 years ago by cboos

Replying to cboos:

... Apparently, the one which gets picked depends on the order within the compiled catalog, as I now see the following in my error page:

Well, I can't reproduce that for now and at the time I had the above error page, I did mix up with a .mo compiled using Genshi trunk. So I don't know if we can end up with the wrong partial translation at runtime or if the "latest wins".

comment:4 Changed 15 years ago by cboos

  • Keywords i18n:msg added

comment:5 Changed 15 years ago by palgarvio

  • Status changed from new to assigned
  • Version changed from 0.5.1 to devel

comment:6 Changed 15 years ago by palgarvio

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

Fixed in [1056]. Please reopen if necessary.

comment:7 Changed 15 years ago by cboos

Fix confirmed, it works both for the extraction and the rendering of the "Before you do that..." message and several other partial ones, thanks!

  • trac/locale/messages.pot

    diff --git a/trac/locale/messages.pot b/trac/locale/messages.pot
    a b  
    88msgstr ""
    99"Project-Id-Version: Trac 0.12\n"
    1010"Report-Msgid-Bugs-To: trac-dev@googlegroups.com\n"
    11 "POT-Creation-Date: 2009-05-12 08:57+0200\n"
     11"POT-Creation-Date: 2009-05-12 08:58+0200\n"
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1414"Language-Team: LANGUAGE <LL@li.org>\n"
     
    15601560msgstr ""
    15611561
    15621562#: trac/templates/error.html:131
    1563 msgid "Before you do that, though, please first try"
    1564 msgstr ""
    1565 
    1566 #: trac/templates/error.html:132
    1567 msgid "searching"
    1568 msgstr ""
    1569 
    1570 #: trac/templates/error.html:132
    1571 msgid "for similar issues"
    1572 msgstr ""
    1573 
    1574 #: trac/templates/error.html:133
    1575 msgid ""
    1576 ", as it is quite likely that this problem\n"
    1577 "                has been reported before. For questions about "
    1578 "installation\n"
    1579 "                and configuration of Trac, please try the"
    1580 msgstr ""
    1581 
    1582 #: trac/templates/error.html:136
    1583 msgid "mailing list"
    1584 msgstr ""
    1585 
    1586 #: trac/templates/error.html:136
    1587 msgid "instead of filing a ticket."
    1588 msgstr ""
    1589 
    1590 #: trac/templates/error.html:131
    15911563msgid ""
    15921564"Before you do that, though, please first try\n"
    15931565"                [1:[2:searching]\n"
     
    26902662msgstr ""
    26912663
    26922664#: trac/ticket/templates/ticket.html:131
    2693 msgid "Opened"
    2694 msgstr ""
    2695 
    2696 #: trac/ticket/templates/ticket.html:131 trac/ticket/templates/ticket.html:132
    2697 msgid "ago"
    2698 msgstr ""
    2699 
    2700 #: trac/ticket/templates/ticket.html:131
    27012665#, python-format
    27022666msgid "Opened %(created)s ago"
    27032667msgstr ""
    27042668
    27052669#: trac/ticket/templates/ticket.html:132
    2706 msgid "Last modified"
    2707 msgstr ""
    2708 
    2709 #: trac/ticket/templates/ticket.html:132
    27102670#, python-format
    27112671msgid "Last modified %(modified)s ago"
    27122672msgstr ""
Note: See TracTickets for help on using tickets.