Moving languages to two letter locales where the four-letter equivalent is not necessary.

This commit is contained in:
Dan Cryer 2014-12-07 11:39:33 +00:00
parent 061215deed
commit 3f15c0618a
4 changed files with 5 additions and 17 deletions

View file

@ -42,10 +42,12 @@ class Lang
{
// Try user language:
if (isset($_SERVER) && array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {
$matches = array();
$langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (preg_match('/([a-zA-Z]{2}\-[a-zA-Z]{2})/', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches)) {
self::$language = strtolower($matches[1]);
foreach ($langs as $lang) {
$parts = explode(';', $lang);
self::$language = strtolower($parts[0]);
self::$strings = self::loadLanguage();
if (!is_null(self::$strings)) {

View file

@ -1,14 +0,0 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
require_once(dirname(__FILE__) . '/lang.en-gb.php');
if (!isset($strings)) {
$strings = array('test' => 'test');
}