Modify

Opened 7 years ago

#1756 new enhancement

[patch] export page/lang suffix variables to other plugins

Reported by: phpxcache@… Owned by: gotoh
Priority: normal Component: TracWikiNegotiatorPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

  • wikinegotiator/negotiator.py

     
    3232            orig = req.args.get('page', 'WikiStart') 
    3333            # set altered page name 
    3434            page = self._decide_page(req) 
     35            name, lang = self._split_lang(page) 
     36            req.args['page_name'] = name 
     37            req.args['page_langsuffix'] = lang 
    3538            if page != orig: 
    3639                req.args['page'] = page 
    3740                self.env.log.debug('Negotiated: %s' % page) 
     
    3942                # page is selected. 
    4043                # TODO: I don't know we should set default language 
    4144                #       for base page. 
    42                 _, lang = self._split_lang(page) 
    4345                req.send_header('Content-Language', 
    4446                                lang or self._default_lang) 
    4547            # always send Vary header to tell language negitiation is 

it would be nice if we can export to other plugins that may want to use is. tracnav is one of those.

Attachments (0)

Change History (0)

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.