Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10616 closed Uncategorized (duplicate)

Meta.permission does not work with lazy translations

Reported by: apollo13 Owned by: nobody
Component: Contrib apps Version: master
Severity: Normal Keywords:
Cc: bronger@…, eschler@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:

Description

http://paste.pocoo.org/show/109432/

Problem is this line:

        permissions = (
                ("only_own", _("Restrict to own Obj.")),
            )

As jacob suggested on irc:

<jacobkm> It's probably a simple fix -- just need a smart_unicode() call somewhere.
<jacobkm> File a ticket and mark it for the 1.1 milestone; we'll get it done.

Attachments (1)

permissions-translations.diff (1.9 KB) - added by Alex 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by Alex

comment:1 Changed 5 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Upon reexamination this is really a dupe of #6460.

comment:2 Changed 5 years ago by hvdklauw

As a note to other people getting the "Error binding parameter 0 - probably unsupported type." error.

You can't translate the permission description name in the model, it's inserted in the database so translations will never work that way. (because then the translated string would be entered in the database and on the fly changing of the language would mean you have to update the database for that user and not for others)

comment:3 Changed 3 years ago by bronger

  • Cc bronger@… added

In this case I think storing the description of a permission in the DB is an error. It should be taken from the code while the program runs. That way, it would be easily translatable. Please consider reopen this ticket if you agree.

comment:4 Changed 3 years ago by deschler

  • Cc eschler@… added
  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized

comment:5 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.