I 'm working on a mutli language site and overall the language switch is working well with exception to 404 pages. Note- site is setup for English (/en) and French (/fr). English being the set default.
When the page not found is loaded on either language (/en or /fr) the correct locale block versions are displayed (logo, nav and footer). However, if you remove the /en or /fr from the url the page loads the french and related locale blocks instead of english and the default block locale (which contains english content).
Page not Found URLs:
EN: http://66.70.164.101/~presidentsacad/_council/en/page_not_found
FR: http://66.70.164.101/~presidentsacad/_council/fr/page_not_found
Version: CMS 8.5.9
PHP: 7.4.3
Hope this makes sense and someone can assist!
Have you seen this discussion?
opened 02:15PM - 06 Mar 18 UTC
closed 10:04PM - 28 Mar 18 UTC
Type:Bug
404 pages have a few issues on multilingual sites, some seem like bugs, others m… ight fall under the purview of enhancements/nice to haves, but I'll post them all here anyway since they all kinda fall under the same umbrella.
I've set this up on the the development branch but these have been present since at least 8.2.1.
Steps to reproduce:
Note: I've included my local urls, but change those where appropriate.
1) Install concrete5, I've set it up with the empty theme but this doesn't matter.
2) Navigate to http://localhost:8888/index.php/dashboard/system/multilingual/setup
3) Add locale
Details: I added *French*, template *Full*, page name *Home*, slug *fr*
3a) I've also enabled toolbar titles for a bit more clarity
4) Add `<?php echo \Concrete\Core\Localization\Localization::activeLocale(); ?>` to `concrete/themes/elemental/page_not_found.php`
4) Navigate to http://localhost:8888/index.php/404
This results in a standard 404 page, with en_US shown on the page as the locale, so this expected behaviour
5) Now try it with the french locale slug http://localhost:8888/index.php/fr/404
This is where things get confusing. This still loads the standard 404 page, but the localization is lost, we are still seeing en_US as the locale, even though we're on the french localization of the site
Additionally, concrete5 seems to not know what language to display here, as we're seeing two related pages language buttons in the toolbar

6) Now, go back to http://localhost:8888/index.php/dashboard/system/multilingual/setup and change the default locale to French
7) Go back to http://localhost:8888/index.php/fr/404
I would expect the locale to now show as fr_FR, but it still shows as en_US
This all makes localization of 404 pages very difficult.
**Halfway solution:**
This isn't really a solution, but it worked for my use case. Hopefully it at least points to a resolution.
http://localhost:8888/index.php/dashboard/system/multilingual/setup change the default locale back to english
The issues are all, as far as I can tell, in: https://github.com/concrete5/concrete5/blob/develop/concrete/src/Http/ResponseFactory.php
Line 92, I've replaced
`$item = '/page_not_found';`
with
```
$home = \Page::getByID(\Page::getCurrentPage()->getSiteHomePageID());
$slug = $home->getCollectionHandle();
$item = '/' . $slug . '/page_not_found';
```
and line 237, I've replaced
`if ($collection->getCollectionPath() != '/page_not_found') {`
with
`if (strpos($collection->getCollectionPath(), '/page_not_found') == false) {`
I also had to copy the `Page Not Found` system page across to all locales using the sitemap in the dashboard.
Now visit http://localhost:8888/index.php/fr/404
This leads to something slightly more in line with expected behaviour. This doesn't fix the duplicate related pages buttons, but they both appear as the correct language now, and the localization locale appears correct now too.
It seems to me that the locale isn't actually ever set on system pages, regardless of the settings. System pages will just always be whatever language the site was installed with.
or this
opened 07:43AM - 15 Jan 16 UTC
closed 11:31PM - 11 Apr 22 UTC
Type:Enhancement
Status:Available
Affects:Visitors
Product Areas:Internationalization
This is a bit related to #3345 "Multilingual Support for login and registration … page".
- Displaying language
- Error message
In Single Page, it only display the error message in the language of the site setting.
It would be nice to somehow add the support for single pages according to the user's language selection.
for example
- 404
- 403
- Login
- Registration
- Members
- Account
and etc...