Last active
December 11, 2015 16:28
-
-
Save betaman/4627374 to your computer and use it in GitHub Desktop.
i18n Problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- bootstrap.php --> | |
<?php | |
// set the language homepage for dynamic navigation | |
define ('HOMEPAGE', 'index-' . $i18n->language); | |
// redirect if they request the default homepage | |
if ($_SERVER['REQUEST_URI'] === '/' || $_SERVER['REQUEST_URI'] === '/index') { | |
$controller->redirect ('/' . HOMEPAGE); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- layouts/default.html about line 24 --> | |
<div class="grid_6 omega menu"> | |
{! navigation/section?section=[constant('HOMEPAGE')] !} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- cache/default.php --> | |
<div class="grid_6 omega menu"> | |
<?php echo $this->controller->run ('navigation/section', array ('section' => Template::sanitize (constant(\'HOMEPAGE\'), 'UTF-8'))); ?> | |
</div> |
Very strange, just did a fresh install from master, added the exact same bootstrap.php, created a few index-lang pages, and changed the {! navigation/top !}
to {! navigation/section?section=[constant('HOMEPAGE')] !}
in layouts/default.html
and I'm not having the backslashed single quotes issue.
My guess is there must be something in lib/Template.php
either in replace_includes()
or replace_vars()
that adds the backslashes or not depending on a PHP setting... Can you send me your phpinfo output? I'll try to match your settings here to see if that uncovers it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
About this Problem again: http://www.elefantcms.com/forum/discussion/comment/1074#Comment_1074
Can you please try out, if this happens to you when doing a clean Install from the Master and go step by Step through this guide: http://www.elefantcms.com/wiki/Multilingual-website-setup
I know you tested it already, but it might have to do that I define the HOMEPAGE CONST in
bootstrap.php