Commit ed58716c authored by Taddeus Kroes's avatar Taddeus Kroes

Removed dependency on php intl extension

parent 1d4aaba3
...@@ -10,9 +10,11 @@ require 'DatabaseAuthenticator.php'; ...@@ -10,9 +10,11 @@ require 'DatabaseAuthenticator.php';
$supported_locales = array('nl_NL'); // English is default, Dutch is optional $supported_locales = array('nl_NL'); // English is default, Dutch is optional
if ($locale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$locale = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE'])[0];
// nl -> nl_NL // nl -> nl_NL
if (locale_get_region($locale) == '') if (preg_match('/^[a-z]{2}$/', $locale))
$locale .= '_' . strtoupper($locale); $locale .= '_' . strtoupper($locale);
if (in_array($locale, $supported_locales)) { if (in_array($locale, $supported_locales)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment