Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
(2013-06-19, 21:20:05)ohayo Wrote: Hi there.
I've go some strange issue with my site:
My homepage on Chrome is always displayed in english, but default lang should be polish. It works just fine in sub-pages and I can switch languages with no problem. On FF/IE/Opera homepage works normally.

I've tried changing the favicon path to root and even removing it completely but it doesn't work.
I'm using pretty urls:

%nondefaultlanguage%/%parent%/%slug%/

PHP Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
^(en)/(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$3&lang=$[QSA,L]
RewriteRule ^(en)/?$ index.php?lang=$[QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
^(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$2&lang=pl [QSA,L

and homepage template looks like this:

PHP Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
?><?php include('inc/doctype_'.$language.'.inc.php'); ?>

<title><?php get_site_name(); ?> / <?php get_custom_field('pagetitle'); ?></title>

<?php include('inc/fonts.inc.php'); ?>
<?php 
include('inc/styles.inc.php'); ?>
<?php 
include('inc/analytics.inc.php'); ?>
<?php 
include('inc/social_'.$language.'.inc.php'); ?>

</head>
<body>
<div id="container">
<?php include('inc/header.inc.php'); ?>
<!-- QUOTE -->
<div id="quote_holder">
    <div class="quote">
    <?php get_i18n_component('quote-1'); ?>
    </div>
</div>
<!-- QUOTE END-->
<!-- WRAPPER -->
<div id="wrapper">
    <div class="wrapperbg">
        <div class="wrapperact">
        <div class="title">
        <h5><?php get_i18n_component('main-haslo'); ?></h5><div class="myButton wycena"><?php get_i18n_component('wycena'); ?></div>
        </div>
        <br class="clear" />
        <div id="content">
            <div id="realizacje">
               <?php include('inc/mainfolio.inc.php'); ?>
            <div class="spacer2"></div>
            <?php get_i18n_component('main-qualities'); ?>
            </div>
        </div>
        </div>
    </div>
</div>
<!-- WRAPPER END -->
<?php include('inc/footer_first.inc.php'); ?>
<div id="tags">
<?php get_i18n_component('tags-1'); ?>
</div>
<?php include('inc/footer_second.inc.php'); ?>
</div>
<!-- CONTAINER END -->
</body>
</html> 

For anyone interested in resolving this problem on Chrome:
Just add
PHP Code:
define('I18N_IGNORE_USER_LANGUAGE',true); 
to the gsconfig.php file.

I don't know why auto language detection fails in Chrome and prevents user from changing lang on homepage. I've tested my site on two computers with different Win installed (Win7 PL, Win8 EN), Chrome set to Polish and couldn't force it to behave like other browsers.

Anyway this little change sorted out my problem and maybe will help mvlcek in pinpointing the problem.
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
RE: Support for multilanguage sites, Internationalization (I18N) - by ohayo - 2013-08-20, 04:22:01
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: 1 Guest(s)