I think you can do something like:
session.language = session.language or T.accepted_language
auth.settings.extra_field['wiki_page']=[Field('language',default=session.language)]
auth.define_tables(....)
auth.wiki(render=False)
db.wiki_page._common_filters.append(lambda
q:db.wiki_page.language==session.language)
I am not sure this belongs in the wiki because I am not convince there is
one way to do it that suits everybody.
Please check it. Perhaps you can help us make a web2pyslice.
Massimo
On Wednesday, 29 May 2013 01:29:13 UTC-5, Daniel Gonzalez wrote:
>
> In the same way as internationalization is handled in the T operator? That
> means that an "accept-language: it- it" would tell the wiki engine to look
> for pages corresponding to the URL which are marked in the database as
> being in italian. That means:
>
> 1. a new field is needed in the database to mark the language the page
> is written in
> 2. the wiki engine would select that page
> 3. a fall back mechanism would return a page in a default language
> (english?)
> 4. when creating new wiki entries, the support views would offer a
> drop-down to specifiy the language in which the page is being created
> (which would default to the accept-language setting)
>
>
> On Tuesday, May 28, 2013 10:29:27 PM UTC+2, Massimo Di Pierro wrote:
>>
>> There is not. The problem is that normal internationalization libraries
>> are not appropriate for wiki pages. I would recommended using different
>> pages for different languages. In your opinion, how should
>> internationalization for wiki pages work?
>>
>> On Tuesday, 28 May 2013 14:35:21 UTC-5, Daniel Gonzalez wrote:
>>>
>>> Hi,
>>>
>>> I have started to use the web2py wiki module, but can not find any
>>> support for internationalization of the wiki pages. What I would like is to
>>> be able to select the language based on some query parameters or some
>>> configuration parameters. Of course, the pages must be already be saved in
>>> the desired language.
>>>
>>> Is there any support for this built-in?
>>>
>>> Thanks,
>>> Daniel
>>>
>>
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.