-
Notifications
You must be signed in to change notification settings - Fork 448
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
pkp/pkp-lib#699 Show locale in url in multilingual contexts #9628
Conversation
jyhein
commented
Jan 19, 2024
- Show the current locale in the url in multilingual contexts.
- Old links without the locale are redirected to include the current locale.
- Monolingual contexts do not have the locale
a4604ca
to
c3c2400
Compare
afd1496
to
6917edb
Compare
36898b7
to
b8b0c6b
Compare
8d352b9
to
7604e75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jyhein, great work! Just a few comments/questions...
a45a065
to
a8f3a46
Compare
45bd597
to
06268f9
Compare
$request->redirectUrl($source); | ||
} | ||
|
||
$uri = Core::removeBaseUrl($setLocale ? ($_SERVER['HTTP_REFERER'] ?? "") : ($_SERVER['REQUEST_URI'] ?? "")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jyhein, in order to support the case that Alec mentioned, I think this line should be something like:
$uri = $_SERVER['PATH_INFO'];
if ($setLocale) {
$uri = Core::removeBaseUrl($_SERVER['HTTP_REFERER'] ?? "");
if (!empty($request->getBasePath())) {
$uri = str_replace($request->getBasePath(), '', $uri);
}
}
Maybe we should also somehow test if it also works if the journal is using/has configured the following part of the config.inc.php:
; Base URL override settings: Entries like the following examples can
; be used to override the base URLs used by OJS. If you want to use a
; proxy to rewrite URLs to OJS, configure your proxy's URL with this format.
; Syntax: base_url[journal_path] = http://www.example.com
;
; Example1: URLs that aren't part of a particular journal.
; Example1: base_url[index] = http://www.example.com
; Example2: URLs that map to a subdirectory.
; Example2: base_url[myJournal] = http://www.example.com/myJournal
; Example3: URLs that map to a subdomain.
; Example3: base_url[myOtherJournal] = http://myOtherJournal.example.com
I think you have such installations, no?