From 7a0a934b5bdcf849ff48289b51cf55e657d8d717 Mon Sep 17 00:00:00 2001 From: micschk Date: Tue, 20 Dec 2011 17:15:04 +0100 Subject: [PATCH] Tried to add-in an option to have multiple locales under one domain, and only force a specific domain on some locales (so remove 1:1 chain). Got as far as redirecting to the right locale if in TLD array, but cannot seem to find a way to switch back to default domain for any of the 'unset' locales... --- code/SingleLocaleDomain.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/SingleLocaleDomain.php b/code/SingleLocaleDomain.php index 2792919..f03105c 100644 --- a/code/SingleLocaleDomain.php +++ b/code/SingleLocaleDomain.php @@ -37,9 +37,9 @@ public function addIgnoredURLSegment($urlSegment=null){ * different than the detected locale of the domain. * * 3 Things to be aware of (while developing.. these are all accounted for here): - * ¥ Intended Locale of the Domain (.fr, .de, .com?) - * ¥ Page's Locale in the Database - * ¥ i18n locale that is in the header. + * � Intended Locale of the Domain (.fr, .de, .com?) + * � Page's Locale in the Database + * � i18n locale that is in the header. * */ @@ -63,7 +63,11 @@ public function contentcontrollerInit(){ } else { //otherwise, find requested page by url, determine locale, and put us in the right domain. $newUrl = TranslatableDomains::convertLocaleToTLD($withEndSlash=false).$this->owner->Link(); - Director::redirect($newUrl); + // redirect only if specific domain is set for locale allows 'catch-all' + // behaviour (on default domain) --> how to set default domain? + if( TranslatableDomains::convertLocaleToTLD(false) ){ + Director::redirect($newUrl); + } } } else i18n::set_locale($this->owner->Locale); }