klaftertief/language_redirect — pull request #14 by vlad-ghita (2012-01-31 11:32:18+00:00)
Title: Some improvements

- after installing from ensemble, if **enabled** from Extensions list, it will update .htaccess rules.
- removed redirect mechanism. Continue reading for discussion.

About redirect:

I noticed a performance hit on my site: [www.xanderadvertising.com](www.xanderadvertising.com) with the previous version of Language Redirect. The redirect requires the Symphony Engine to initialize and execute the Events attached to a Page before the effective redirect takes place. Adding this to some other factors, there was a penalty of at least 2-3 seconds in page load time.

The changes in this commit will remove the redirection mechanism and instead [detect the language](https://github.com/vlad-ghita/language_redirect/blob/master/lib/class.languageredirect.php#L271-321) as follows (if not found at current point, proceed to next point):

0. On LanguageRedirect initialization, [get from $_REQUEST](https://github.com/vlad-ghita/language_redirect/blob/master/lib/class.languageredirect.php#L199-200).

1. try to get from Cookie
2. try to get from Geolocation Service extension (very useful)
3. try to get from browser's languages
4. try english (this is good in my case. Perhaps you would like to [remove it](https://github.com/vlad-ghita/language_redirect/blob/master/lib/class.languageredirect.php#L314-317))
5. defaults to first supported language-code.

This will comply very well with Search Engines who will index only `www.xanderadvertising.com` instead of `www.xanderadvertising.com/ro/` or `www.xanderadvertising.com/en/`.