Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
I was searching for the possibilities to customize the error 404 page. Have found How to change 404 error message (lang) and have added that info to /wiki/404

Then I have found a discussion of (i think) Pre 3.0 time: 404 Page Translation : Dev Questions & Vote. Quotes from there:
mvlcek 2011-03-13 19:39:02 Wrote:Just check if there is a page with slug name 404 (404.xml) and display it, if it exists.
This way on multilanguage sites (I18N plugin), users can create pages 404_de, 404_it, etc. to present the error in the correct language.
mvlcek 2011-04-08 21:57:11 Wrote:
krisu Wrote:My suggestion is that translators should able translate the 404 with translation file, but user can have control over it if he wants way that mvlcek suggested.
Yes that's best: If there is a page 404.xml, display it (like a normal page is displayed, i.e. with hooks), otherwise display the default title/message, which should be read from the language files instead of being hardcoded.

By displaying the 404-page with all hooks, the correct language page can be displayed (with the I18N plugin) and one can even create a page that would display the search results from searching with the URL...

I use GS 3.1 and I18N 2.6 with (de) as standard and (en) and (it) as secondary languages. I have enabled FancyURLs with "%language%/%parent%/%slug%/". I haven't found better informations of how 404 probably works actually on a installation like this.
I have created 404 page in german and 404_en and 404_it pages. Now when I try to view a non existing URL on the GS-Installation (exampe: domain.com/xyz) I receive with every browser language (de, en, it) every time only the (de) 404 page. Also domain.com/en/xyz did not change everything.

Can somebody help me in this, is it the .htaccess RewriteEngine ?
Code:
# RewriteRule ^/?$ de/ [R,L]   # redirect to language of your choice. Quote out if undesired.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|de|it)/(.*?/)?([A-Za-z0-9_-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(en|de|it)/?$ index.php?lang=$1 [QSA,L]   # handle index page without 'index'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
Advanced HTML5 & CSS3 coder. Simple JS & PHP hacker (not enough for new function coding). Build one webpage with GS (late 2012). Focusing on Theme customizing/Template files. Experience with WP.
Reply


Messages In This Thread
rewrite language problem - by tomkop - 2013-03-27, 06:34:44
Enhancement suggestion - by hameau - 2013-05-12, 04:17:12
Enhancement request - by hameau - 2013-06-14, 20:02:07
RE: Enhancement request - by mvlcek - 2013-06-14, 22:04:12
RE: Enhancement request - by hameau - 2013-06-14, 23:01:36
Duplicate language cookies bug - by enzy - 2013-08-20, 07:03:26
RE: Duplicate language cookies bug - by ohayo - 2013-08-20, 18:12:25
Plugin is not shown - by tosho - 2013-09-15, 12:10:37
1000 pages limit in i18n_navigation - by titus - 2014-10-13, 21:58:36
Bug found - by lbarsov - 2014-10-17, 03:41:53
Menu with picture - by Dimi - 2015-04-28, 16:05:45
Rendering Menu in Component - by Alexander_ - 2016-05-04, 23:06:51
Meta desc for different languages - by Alexander_ - 2017-02-14, 20:29:32
Hierarchical Menus - by celextel - 2019-07-26, 16:41:47
Ri18n_navigation - by celextel - 2021-02-19, 16:07:48
Support for multilanguage sites, Internationalization (I18N) - by ChriS - 2012-03-13, 01:03:04



Users browsing this thread: 4 Guest(s)