T.force('en-zh')
On Apr 14, 6:20 am, CK Ng <nicec...@gmail.com> wrote:
> I've created a simple appliance, and it needs to be in Chinese as
> default language, En as a fall back.
> Setting it using browser is not ideal as users are multi-lingual and
> probably accessing from public computer.
>
> I've tried putting this into the controller but to no avail.
>
> def index():
> request.env.accept_language='en-zh'
> import gluon.languages
> gluon.languages.translator.__init__(T,request) # reloads the
> language file
>
> Q:
> 1 - How to set the default language for an appliance? What are the
> language files to create?
> 2 - What's the convention of naming the language file. For chinese,
> there is zh-CN (chinese simplified) and zh-TW (chinese traditional),
> which are different in term of script not language, so there is
> actually no zh.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---