Skip to content

Instantly share code, notes, and snippets.

@hissy
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissy/23e496e83613ca82b914 to your computer and use it in GitHub Desktop.
Save hissy/23e496e83613ca82b914 to your computer and use it in GitHub Desktop.
concrete5で、特定のディレクトリだけ英語サイトにする(Internationalizationアドオンを使わない簡易版)(〜5.6.x)
<?php
// config/site_post.php
defined('C5_EXECUTE') or die("Access Denied.");
$req = Request::get();
$reqPath = $req->getRequestPath();
if ( strpos($reqPath, 'en/') !== false ) {
Localization::changeLocale('en_US');
}
<?php
// config/site_post_autoload.php
defined('C5_EXECUTE') or die("Access Denied.");
$req = Request::get();
$reqPath = $req->getRequestPath();
if ( strpos($reqPath, 'en/') !== false && !defined('SITE') ) {
define('SITE', 'English Site Name');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment