On 6 Jan 2014, at 1:17 AM, Rockiger <rocki...@googlemail.com> wrote:
> Hi Jonathan,
> 
> many thanks for the answer:
> 
> Here ist mit request object: http://pastie.org/8605943
> 
> The URL ist http://rockiger.com/de/domainfactory/kontoeroeffnung.
> 
> It seems there is a variable request.uri_language: de in that case.
> 
> It would be very interesting to know what precisely do this two directives:
>>  default_language = 'de',
>>  languages = ['en', 'de'],
> Which code in web2py interprets that?
> 

Thanks for following up. It appears that both the cookbook and the example file 
are incorrect. Here's the corrected text from the examples file; I'll send a 
patch now. I've also added a note on how to integrate the incoming language 
with the T() operator.

#  languages: list of all supported languages
#       Names in languages are always treated as language names when they 
appear in an incoming URL after
#       the (optional) application name.
#  default_language
#       The language code (for example: en, it-it) optionally appears in the 
URL following
#       the application (which may be omitted). For incoming URLs, the code is 
copied to
#       request.uri_language; for outgoing URLs it is taken from 
request.uri_language.
#       If languages=None, language support is disabled.
#       The default_language, if any, is omitted from the URL.
#       To use the incoming language in your application, add this line to one 
of your models files:
#           if request.uri_language: T.force(request.uri_language)

As to your question: the code is in gluon.rewrite, specifically in the classes 
MapUrlIn and MapUrlOut.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to