Change 404 site

Permalink Browser Info Environment
Where can I change and find the file of the error/404 site? This is now English and wants to change this. Thanks in advance.

Type: Discussion
Status: Resolved
rheveling
View Replies:
shahroq replied on at Permalink Reply
shahroq
Hi,
\packages\theme_pixel\themes\pixel\page_not_found.php
pedroC5 replied on at Permalink Reply
pedroC5
Hi, I succeed to do this with version 2.3 but not with v2.4 is something changed?
I uploaded translated new page_not_found.php file and cleared cache. Text still in english on 404 error page.
shahroq replied on at Permalink Reply
shahroq
What do you want to do? The 404 template is already in the provided path, and it should be rendered if the theme is active.
pedroC5 replied on at Permalink Reply 1 Attachment
pedroC5
I tried to translate Error 404 page texts which are in english.

I translate /packages/theme_pixel/themes/pixel/page_not_found.php three text lines (22, 27, 28). I saved, uploaded and replaced original file. Then I cleared cache, but on this site using Pixel theme version 2.4 Error 404 page is still in english even the file page_not_found.php is translated. On the other site using older v2.3 Pixel version same changes succeeded.
shahroq replied on at Permalink Reply
shahroq
Hi,
Add this piece in `\packages\theme_pixel\themes\pixel\page_not_found.php` after line 4 and it should fix it:

$app = \Concrete\Core\Support\Facade\Application::getFacadeApplication();
$site = $app->make('site')->getSite();
$defaultLocale = $site->getDefaultLocale();
$defaultLocaleCode = $defaultLocale->getLocale();
$loc = Localization::getInstance();
$loc->setActiveContext(Localization::CONTEXT_SITE);
$loc->setContextLocale(Localization::CONTEXT_SITE, $defaultLocaleCode);
pedroC5 replied on at Permalink Reply 1 Attachment
pedroC5
No change. 404-page message still in english :(
In the page_not_found.php file includes my finnish translation text.

On attachment is your code, is it placed right?
shahroq replied on at Permalink Reply 1 Attachment
shahroq
Put the PHP closing tag at the end. (check attached screenshot)

concrete5 Environment Information

# concrete5 Version
Core Version - 8.4.2
Version Installed - 8.4.2
Database Version - 20180716000000

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.