I don't like the idea of being forced to use pdoTools, however.
What I also really don't like is working in a javascript pop up box.
no need to re-invent any wheels.One said https://twitter.com/StartupLJackson/status/174667330914234369 .
We've been a longtime Babel-user and still use it in all our new projects. We checked the migxmutlilang addon but have some objections to use it. We made a pro's and con's list
Cons:
- There is no way to get unique URL prefixes for language-specific resources, eg: site.com/en/home, site.com/nl/home, site.com/de/home
- There is no way to get a seperate domain name for a language, eg: site.com/home, site.nl/home, site.de/home (there is a possibility with a dirty htaccess hack, but that's not really what we want)
- Can't use TV's
- Can't use Wayfinder or getResources
- We think an end-user will not experience it as logical
- You always have all languages for a page. There's no possibility to make one page language-specific. You have to use all languages, even if you don't want to
Pros:
- A clean resource tree
This led us to the the conclusion that we keep using Babel.
if (!function_exists('clientLangDetect')) { function clientLangDetect($modx) { /*$langs = array(); if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { # break up string into pieces (languages and q factors) preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse); if (count($lang_parse[1])) { # create a list like "en" => 0.8 $langs = array_combine($lang_parse[1], $lang_parse[4]); # set default to 1 for any without q factor foreach ($langs as $lang => $val) { if ($val === '') $langs[$lang] = 1; } # sort list based on value arsort($langs, SORT_NUMERIC); return $langs; } }*/ switch ($modx->getOption('http_host',null,'')) { case 'www.example.cz': return array("cs"=>"1"); default: return array("en"=>"1"); } } }
$clientCultureKey = array_flip(array_intersect_key(clientLangDetect(), $languages));
$clientCultureKey = array_flip(array_intersect_key(clientLangDetect($modx), $languages));
what are your requirements, regarding permissions?