Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
(2013-04-10, 04:47:21)mvlcek Wrote:
(2013-04-10, 02:10:43)TeeJay Wrote: 3) When using custom permalinks showing only the secondary language, in the admin panel I wrote
Code:
%nondefaultlanguage%/%parent%/%slug%/
and changed .htaccess like this:
Code:
...

# To make custom permalinks with the secondary language only work :)
RewriteRule ^/?$ cs/ [R,L]   # optional
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(cs|en)/(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(cs|en)/?$ index.php?lang=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$2&lang=en [QSA,L]

Looks fine.

Found the problem. It was the last line which is ending with "en", but it has to be ending with the standard language code which is "cs" for me.
It would be nice to emphasize this fact, it can be easily overlooked.


However I need some special rewrite rules for the News Manager now, because the posts of the NM don't seem to work in the second language with /en/ in the address. When there is nothing it works.

I have already asked in my topic about this problem.
http://get-simple.info/forums/showthread.php?tid=4659


What could be interesting for you maybe is that adding the second version of NM rewrite rules for the secondary langauge (English)
Code:
RewriteRule ^clanky/tag/([^/.]+)/?$ index.php?id=clanky&tag=$1 [L]
RewriteRule ^clanky/post/([^/.]+)/?$ index.php?id=clanky&post=$1 [L]
RewriteRule ^clanky/page/([^/.]+)/?$ index.php?id=clanky&page=$1 [L]
RewriteRule ^clanky/archive/([^/.]+)/?$ index.php?id=clanky&archive=$1 [L]

RewriteRule ^en/clanky/tag/([^/.]+)/?$ index.php?id=clanky&tag=$1 [L]
RewriteRule ^en/clanky/post/([^/.]+)/?$ index.php?id=clanky&post=$1 [L]
RewriteRule ^en/clanky/page/([^/.]+)/?$ index.php?id=clanky&page=$1 [L]
RewriteRule ^en/clanky/archive/([^/.]+)/?$ index.php?id=clanky&archive=$1 [L]
make it work but always after clicking onto a post it switches the language to English.

If you knew what to do, it would be nice. Thank you.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply


Messages In This Thread
rewrite language problem - by tomkop - 2013-03-27, 06:34:44
RE: Support for multilanguage sites, Internationalization (I18N) - by TeeJay - 2013-04-22, 01:29:49
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



Users browsing this thread: 8 Guest(s)