Opened 9 years ago

Closed 6 years ago

Last modified 6 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: master
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: UI/UX:

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 Changed 9 years ago by Simon Greenhill <dev@…>

Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Horst Gutmann

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 Changed 6 years ago by Julien Phalip

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

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

comment:4 Changed 6 years ago by Chris Beaven

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