smlbiobot
Right now I can switch language using the same URL but if I want to say use /zh/path to serve /path in Chinese, I don't quite know how I would achieve that. Any help would be greatly appreciated!
#2 · open · 2 comments
Right now I can switch language using the same URL but if I want to say use /zh/path to serve /path in Chinese, I don't quite know how I would achieve that. Any help would be greatly appreciated!
try to save language code in session when accessing /zh/path then /path can get language from session?
I am already saving language code in session — what I want to achieve is allowing /zh/path to always points to /path under the hood — I can’t figure out how I might do that without writing every single route out — and on my website that is a lot of paths. Flasks have something like this: http://flask.pocoo.org/docs/0.12/patterns/urlprocessors/ So right now with the session, I am able to switch session but they all point to /path (because the language is in the session). And what I need is be able to depending on session point to /zh/path but have the language stay on that path. So for example, say in the HTML I point to /pathA if I am in Spanish mode, that it auto point to /es/pathA and fetch what is normally in /pathA. If it helps, this is my current site: http://royaleapi.com — and the language is switched from the top right language selector. You will see that the same path serves all the different languages but it confuses the search engines.