[issue31159] Doc: Language switch can't switch on specific cases

2017-09-23 Thread Julien Palard

Changes by Julien Palard :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-13 Thread STINNER Victor

STINNER Victor added the comment:

To choose the langague, see what Wikipedia does: Wikipedia EN displays
"Français", no?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset fe8d9dc479a96ef490034107e7d4a6228b4be140 by Victor Stinner 
(Julien Palard) in branch '2.7':
bpo-31159: fix language switch regex on unknown yet built languages. … (#3051) 
(#3081)
https://github.com/python/cpython/commit/fe8d9dc479a96ef490034107e7d4a6228b4be140


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-13 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3123

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-10 Thread STINNER Victor

STINNER Victor added the comment:


New changeset e8e7fba0b24582959feca9c31f2a72fc0251f83d by Victor Stinner 
(Julien Palard) in branch '3.6':
bpo-31159: fix language switch regex on unknown yet built languages. … (#3051)
https://github.com/python/cpython/commit/e8e7fba0b24582959feca9c31f2a72fc0251f83d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-10 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3098

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-10 Thread Julien Palard

Julien Palard added the comment:

Now works in 3.7, needs backports to 3.6 and 2.7.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-09 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 122081deef86174beee965be1207fa46ea23533d by Victor Stinner 
(Julien Palard) in branch 'master':
bpo-31159: fix language switch regex on unknown yet built languages. (#3039)
https://github.com/python/cpython/commit/122081deef86174beee965be1207fa46ea23533d


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-09 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3072

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31159] Doc: Language switch can't switch on specific cases

2017-08-09 Thread Julien Palard

New submission from Julien Palard:

Since ja has been added to the language switch, a bug appeared and in some case 
the switch won't ... switch.

Due to a regex bug in switchers.js, a needed trailing slash is sometimes not 
matched. It has not been detected previously as it can happen only when there 
more than two languages in the picker which is now the case.

Bug is in:  var language_regexp = '\.org/(' + 
Object.keys(all_languages).join('|') + '/)';

It only matches the trailing slash for the last language, currently the / is 
for ja, so fr does no longer match the needed slash.

Fix may consists in adding a non-matching group around the join.

But there's another issue when a user goes to a version in which there's a 
language picker but the current langage is not known by the picker, typically 
if a user is on /ja/2.7/ but the language picker with Japanese has only been 
merged on 3.6 and 3.7: the regex on /ja/2.7 will not contain "ja", so it will 
not be able to match it.


So we should write this regex otherwise, I grepped on the server logs and 
checked on the filesystem, this one should work better and still be safe:


var language_regexp = '\.org/([a-z]{2}(?:-[a-z]{2})?/)';

--
messages: 20
nosy: mdk
priority: normal
severity: normal
status: open
title: Doc: Language switch can't switch on specific cases

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com