Opened 8 years ago

Closed 4 years ago

Last modified 4 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 7 years ago by Simon Greenhill <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by zerok

  • Triage Stage changed from Accepted to Design 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 4 years ago by julien

  • Resolution set to wontfix
  • Severity set to Normal
  • Status changed from new to closed
  • Type set to Uncategorized

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

comment:4 Changed 4 years ago by SmileyChris

  • Type changed from Uncategorized to Bug
Note: See TracTickets for help on using tickets.
Back to Top