Skip to content

Redirect to the default version of any translation when visiting /{lang}/ #2968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mfrasca opened this issue Jun 23, 2017 · 11 comments · Fixed by #10313
Closed

Redirect to the default version of any translation when visiting /{lang}/ #2968

mfrasca opened this issue Jun 23, 2017 · 11 comments · Fixed by #10313
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required

Comments

@mfrasca
Copy link

mfrasca commented Jun 23, 2017

Details

I have registered the project as Italian translation of ghini. Italian is one of a couple translations I have registered for the Ghini project. Others are French and Spanish. These work as a charm.

Expected Result

translated project documentation visible at short url: http://ghini.readthedocs.io/it/

Actual Result

maze found at http://ghini.readthedocs.io/it/

A description of what actually happened
the translated docs are built, and I can see them at http://ghinidesktop-docsi18n-it.readthedocs.io/, but not at the shorter link, which is the one offered to the user.
image

I tried twice: remove the project, create it again, same result. I have forced a build, same result. I did not yet try to create the project under a different name, I will do so shortly (without removing the one which is not working) and comment here. but I would rather follow a uniform project naming policy.

@mfrasca
Copy link
Author

mfrasca commented Jun 23, 2017

under a different name ghini-it works, but the link again does not. I find a different maze, not "page not there yet" but "permission denied".

@mfrasca
Copy link
Author

mfrasca commented Jun 25, 2017

I did not change anything and it now works. I will try with registering one more translation, and report here.

@mfrasca
Copy link
Author

mfrasca commented Jun 25, 2017

http://ghinidesktop-docsi18n-ar.readthedocs.io/ar/latest/ (gives the still totally untranslated documentation, but it does show the desired page)
http://ghini.readthedocs.io/ar/latest/ (gives Maze found, Permission Denied)

@stsewd
Copy link
Member

stsewd commented Jan 7, 2018

Hi, are you still having this issue? All the links provided work properly (I really don't understand your last comment, sorry)

@mfrasca
Copy link
Author

mfrasca commented Jan 7, 2018

I had forgotten about this, I think it has to do with the fact I'm not using 'master': I'm working with branches 'ghini-1.0-dev' and 'ghini-1.1-dev' and 'master' does not mean much to me.

http://ghini.readthedocs.io/it/ does not work,
http://ghini.readthedocs.io/it/ghini-1.0-dev works
and I wish to use the first, shorter link, when telling people where they can find the translated docs.

ghini-1.0-dev is the default version for all projects, the one being translated as well as its translations, but only http://ghini.readthedocs.io/ correctly sends me to http://ghini.readthedocs.io/ghini-1.0-dev, for translations I have to type the complete url, or a maze is found.

@stsewd
Copy link
Member

stsewd commented Apr 5, 2018

So the problem here is to redirect to the default version of any translation when visiting /{lang}/.

@mfrasca
Copy link
Author

mfrasca commented Apr 5, 2018

yes, this is a better title for the issue. I guess it wasn't clear to me either, what was going on.

@stsewd stsewd changed the title registering project as italian translation fails Redirect or use / for default language (/) -> (/en) Apr 18, 2018
@stsewd
Copy link
Member

stsewd commented Apr 18, 2018

I changing the title to be more accurate to the real issue

@mfrasca
Copy link
Author

mfrasca commented Apr 18, 2018

@stsewd , are you sure it's clear enough? or was the clearer option too long?
redirect to the default version of any translation when visiting /{lang}/
the problem is namely not with the default language, but with the translations.

@stsewd stsewd changed the title Redirect or use / for default language (/) -> (/en) Redirect to the default version of any translation when visiting /{lang}/ Apr 19, 2018
@stsewd stsewd added Improvement Minor improvement to code Needed: design decision A core team decision is required labels May 10, 2018
@humitos
Copy link
Member

humitos commented Mar 25, 2019

Supporting this is not trivial since these files are served by nginx directly and does not hit the Django instance. So, at that level, we don't know what it's the default version.

In case we want to handle this, we would need to redirect /{lang}/ requests to Django, and it will needs to return a 302 to the full path containing the default version.

@humitos
Copy link
Member

humitos commented Feb 1, 2023

A lot of things have changed since this issue was opened. We are now using El Proxito, which is a proxy implemented in Python and we have access to the database at this point. If we want to, we could properly redirec /{lang}/ to the default version of that language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants