translation

14 views
Skip to first unread message

Marco Giuliani

unread,
Sep 23, 2013, 5:46:04 AM9/23/13
to qtalch...@googlegroups.com
Hi!

It's possibile to translate standard button returned by this function? ("new", "delete" ecc...)

self.entity.itemCommands.withView(self.table, bindDefault=True) 

I've tried to load a custom ".qm" file for translation, but it doesn't work

Thanks

Marco Giuliani

Joel B. Mohler

unread,
Sep 24, 2013, 2:35:00 PM9/24/13
to qtalch...@googlegroups.com
Marco,

Yes, I believe that replacing

@itemCommands.itemNew()
def new(self, ...):

with

@itemCommands.itemNew(descr=app.tr('&New'))
def new(self, ...):

should be sufficient. (The object 'app' needs to be some QObject you
have ... as I'm sure you've guessed.) I think New and Delete are the
only user visible strings I hard-code in qtalchemy.

However, it would be good for me to apply a change in qtalchemy code
that and wrap '&New...' and '&Delete...' for translation.

Joel

Reply all
Reply to author
Forward
0 new messages