Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#6258 closed Bug (wontfix)

BlockTrans with variables does not support simple id-strings

Reported by: Geir Gunnarsson <geir@…> Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords: blocktrans, msgid, msgstr
Cc: atli@… Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

After changes to i18n.py done in revision 6682 our blocktrans translations stopped working. We were not using the translations as documented so I guess we can not complain much :)
A typical usage in our web is:

{%blocktrans with "Reykjavik" as cityname%}bookhotelwith{%endblocktrans%}

where our .po file for English would include:

msgid "bookhotelwith"
msgstr "%(cityname)s ads"

and our .po file for Spanish would include:

msgid "bookhotelwith"
msgstr "%(cityname)s anuncios"

Now, after the fix we are forced to use the English version of the string as the msgid. This means that our msgid-s will be a lot longer and our worst case is where the English string is 527 characters. To us it looks more sensible to allow arbitrary identifiers for the strings to be translated. Our arbitrary identifiers work as before in regular trans-tags because there is no variable substitution in those.

Change History (4)

comment:1 by Simon Greenhill <dev@…>, 16 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Horst Gutmann, 14 years ago

Triage Stage: AcceptedDesign decision needed

If I understand your issue correctly you're actually aiming for a Java-property like internationalization/configuration system, which I can definitely see a use-case for. On the other hand, in my opinion, this doesn't really belong into blocktrans but perhaps into a separate template tag provided by an external library/application. Marked as "design decision needed" as suggested by Jannis.

comment:3 by Julien Phalip, 13 years ago

Resolution: wontfix
Severity: Normal
Status: newclosed
Type: Uncategorized

Using the original string as the msgid is in fact the correct behaviour.

comment:4 by Chris Beaven, 13 years ago

Type: UncategorizedBug
Note: See TracTickets for help on using tickets.
Back to Top