#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
2723 2723 msgstr "" 2724 2724 2725 2725 #: trac/ticket/templates/ticket.html:128 2726 msgid "Opened"2727 msgstr ""2728 2729 #: trac/ticket/templates/ticket.html:128 trac/ticket/templates/ticket.html:1292730 msgid "ago"2731 msgstr ""2732 2733 #: trac/ticket/templates/ticket.html:1282734 2726 #, python-format 2735 2727 msgid "Opened %(created)s ago" 2736 2728 msgstr "" 2737 2729 2738 2730 #: trac/ticket/templates/ticket.html:129 2739 msgid "Last modified"2740 msgstr ""2741 2742 #: trac/ticket/templates/ticket.html:1292743 2731 #, python-format 2744 2732 msgid "Last modified %(modified)s ago" 2745 2733 msgstr ""
Change History (7)
comment:1 Changed 16 years ago by cboos
comment:2 follow-up: ↓ 3 Changed 16 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 16 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 16 years ago by cboos
- Keywords i18n:msg added
comment:5 Changed 16 years ago by palgarvio
- Status changed from new to assigned
- Version changed from 0.5.1 to devel
comment:6 Changed 16 years ago by palgarvio
- Resolution set to fixed
- Status changed from assigned to closed
Fixed in [1056]. Please reopen if necessary.
comment:7 Changed 16 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 8 8 msgstr "" 9 9 "Project-Id-Version: Trac 0.12\n" 10 10 "Report-Msgid-Bugs-To: trac-dev@googlegroups.com\n" 11 "POT-Creation-Date: 2009-05-12 08:5 7+0200\n"11 "POT-Creation-Date: 2009-05-12 08:58+0200\n" 12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 14 "Language-Team: LANGUAGE <LL@li.org>\n" … … 1560 1560 msgstr "" 1561 1561 1562 1562 #: trac/templates/error.html:131 1563 msgid "Before you do that, though, please first try"1564 msgstr ""1565 1566 #: trac/templates/error.html:1321567 msgid "searching"1568 msgstr ""1569 1570 #: trac/templates/error.html:1321571 msgid "for similar issues"1572 msgstr ""1573 1574 #: trac/templates/error.html:1331575 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:1361583 msgid "mailing list"1584 msgstr ""1585 1586 #: trac/templates/error.html:1361587 msgid "instead of filing a ticket."1588 msgstr ""1589 1590 #: trac/templates/error.html:1311591 1563 msgid "" 1592 1564 "Before you do that, though, please first try\n" 1593 1565 " [1:[2:searching]\n" … … 2690 2662 msgstr "" 2691 2663 2692 2664 #: trac/ticket/templates/ticket.html:131 2693 msgid "Opened"2694 msgstr ""2695 2696 #: trac/ticket/templates/ticket.html:131 trac/ticket/templates/ticket.html:1322697 msgid "ago"2698 msgstr ""2699 2700 #: trac/ticket/templates/ticket.html:1312701 2665 #, python-format 2702 2666 msgid "Opened %(created)s ago" 2703 2667 msgstr "" 2704 2668 2705 2669 #: trac/ticket/templates/ticket.html:132 2706 msgid "Last modified"2707 msgstr ""2708 2709 #: trac/ticket/templates/ticket.html:1322710 2670 #, python-format 2711 2671 msgid "Last modified %(modified)s ago" 2712 2672 msgstr ""
[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).