Hi all,
I want to make my Auth's registration table's label support translation.
So I add a fields in Auth
"auth.settings.register_labels"
Also add this in register method in tools.py:
form = SQLFORM(table_user,
fields = self.settings.register_fields,
hidden = dict(_next=next),
showid=self.settings.showid,
submit_button=self.messages.register_button,
delete_label=self.messages.delete_label,
formstyle=formstyle,
separator=self.settings.label_separator,
labels = self.settings.register_labels
)
So that I can support registation form translation use code showing below:
auth.settings.register_labels = {'email' :
T('Email'),'password':T('Password'), \
'accept_promotion':T('Accept promotion Email?')}
May I ask is any better way I can achieve this?
Thanks for your help!