I have a countries.py module living in my web2py applications module folder. It defines the following tuple:
COUNTRIES = (
('AF', T('Afghanistan')),
('AX', T('Aland Islands')),
('AL', T('Albania')),
('DZ', T('Algeria')),
('AS', T('American Samoa')),
('AD', T('Andorra')),
('AO', T('Angola')),
('AI', T('Anguilla')),
...
Which can be use to create country drop down list. The problem I have is I get an error:
<type 'exceptions.NameError'> name 'T' is not defined
So how can I use the translator T
from a web2py module?
Based on this post in the google group:
https://groups.google.com/forum/#!topic/web2py/cHSKbhbcSSA
I added
to the top of my countries.py module and it seems to be working now.