Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29538581: #3421 - Do root rewrite before rewriting to translated page (Closed)

Created:
Sept. 7, 2017, 8:41 a.m. by f.nicolaisen
Modified:
Sept. 11, 2017, 4:12 p.m.
Reviewers:
mathias
CC:
f.lopez, Fred
Base URL:
https://hg1/infrastructure
Visibility:
Public.

Description

#3299 - Redirect for missing translations There are parameters that influence rewrite behavior when requesting a web page: 1) accept-language header and availabity of translated pages 2) agent (may rewrite to browser specific page for downloads or documentation) In case there exists a translation set, for example Mexican (es-MX), with a page is missing that has (2) agent specific rewrite, it will first be assumed that the translation is availble (bcause the folder /es_MX/ exists). Then the rewrite will be made to the agent specific page, for example /es_MX/firefox. As a result of this, a user/browser configured with accept-languaget es-MX will visit adblockplus.org - get rewritten to /es_MX/ - and subsequently get rewritten to /es_MX/firefox which results in a 404. This commit handles this by moving the (2) agent rewrite to occur before the checking of available translations. The same user/browser will now visit adblockplus.org - get rewritten to /firefox - and then fall back to seeing the page in Spanish (language fallback), or in case the language is missing completely, English (default locale).

Patch Set 1 #

Patch Set 2 : more details in commit msg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -5 lines) Patch
M modules/web/templates/site.conf.erb View 1 2 chunks +6 lines, -5 lines 0 comments Download

Messages

Total messages: 5
f.nicolaisen
Sept. 7, 2017, 8:41 a.m. (2017-09-07 08:41:17 UTC) #1
f.nicolaisen
This was hotfixed to production yesterday. I'm not planning to make new patch sets (unless ...
Sept. 8, 2017, 1:57 p.m. (2017-09-08 13:57:38 UTC) #2
mathias
I think there are two reasons nobody replied thus far: 1. You used the wrong ...
Sept. 8, 2017, 7:10 p.m. (2017-09-08 19:10:33 UTC) #3
f.nicolaisen
On 2017/09/08 19:10:33, mathias wrote: > I think there are two reasons nobody replied thus ...
Sept. 11, 2017, 7:13 a.m. (2017-09-11 07:13:35 UTC) #4
mathias
Sept. 11, 2017, 3:12 p.m. (2017-09-11 15:12:46 UTC) #5
LGTM.

Powered by Google App Engine
This is Rietveld