CutCodeDown

Squire / Paladin => Squire/Paladin General Discussion => Topic started by: xmohamadx on 1 Dec 2020, 08:11:02 pm

Title: Getting language from URL
Post by: xmohamadx on 1 Dec 2020, 08:11:02 pm
The "Lang" class already implemented to make a multi-language website, but there is nothing to get user language from URL.

Jason Knight, as you said before:
As to the language thing, I'd probably put the language AFTER the page name, and use "Friendly URI's" to make extracting what pages people are trying to view easier.
so I assume we should expect something like this:
domainName.com/pageName/english[or for short: "en"]

Then it seems to me, it should be the "Request" class job to parse user language and maybe set it by Settings class and then remove it from the $data exists in the Request class.
Title: Re: Getting language from URL
Post by: Jason Knight on 2 Dec 2020, 06:43:36 pm
The lang handler as currently coded is meant for site-wise use from the user.ini.php, however changing the language would/should be handled by the user account, probably as one of the extra dynamic parameters (not yet configured) or by adding it to the user table.

It's not something I'd generally hardcode into uri's, but again I wouldn't keep multiple installations of the same language CONTENT on the same website. As I've said many the time, I've only ever seen that end in tears with a mis-mash of multilanguage content that annoys not just the folks managing it, but also the people using the visitors.

Multi-language of that depth is ALWAYS a bad idea.