Skip to content

Commit

Permalink
fix trnslit & formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiryuriev committed May 4, 2013
1 parent 3a2f932 commit 247bb9a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
19 changes: 7 additions & 12 deletions engine/lib/external/UserLocale/UserLocale.class.php
Expand Up @@ -16,8 +16,8 @@
* -------------------------------------------------------
*/

class UserLocale
{
class UserLocale {

static $sDefaultLanguage = 'ru';
static $aDefaultLocale = array(
'name' => 'Russian',
Expand All @@ -34,8 +34,7 @@ class UserLocale
static $sCurrentLanguage = 'ru';
static $aLocales = array();

static function initLocales($aLangs = null)
{
static function initLocales($aLangs = null) {
if (!$aLangs) {
self::$aLocales[self::$aDefaultLocale] = self::$aDefaultLocale;
} else {
Expand All @@ -51,26 +50,23 @@ static function initLocales($aLangs = null)
}
}

static function getLocale($sLang = '', $sItem = '')
{
static function getLocale($sLang = '', $sItem = '') {
$xResult = self::$aLocales;
if (!$sLang) $sLang = self::$sCurrentLanguage;
if ($sLang AND isset($xResult[$sLang])) $xResult = $xResult[$sLang];
if ($sItem AND isset($xResult[$sItem])) $xResult = $xResult[$sItem];
return $xResult;
}

static function setLocaleSys($sLocale)
{
static function setLocaleSys($sLocale) {
if (is_string($sLocale) AND strpos($sLocale, ',')) {
$aLocales = array_map('trim', explode(',', $sLocale));
return setlocale(LC_ALL, $aLocales);
}
return setlocale(LC_ALL, $sLocale);
}

static function setLocale($sLang = null, $aParam = array())
{
static function setLocale($sLang = null, $aParam = array()) {
if (!$sLang) $sLang = self::$aDefaultLocale;
if (!isset(self::$aLocales[$sLang])) self::initLocales($sLang);
if (isset(self::$aLocales[$sLang])) {
Expand All @@ -86,8 +82,7 @@ static function setLocale($sLang = null, $aParam = array())
self::$sCurrentLanguage = $sLang;
}

static function getAvailableLanguages($bScanDir = false)
{
static function getAvailableLanguages($bScanDir = false) {
$aLanguages = array();
$sFile = __DIR__ . '/i18n/_languages.php';
if (is_file($sFile)) {
Expand Down
2 changes: 1 addition & 1 deletion engine/lib/external/UserLocale/i18n/be.php
Expand Up @@ -11,7 +11,7 @@
// All cyrillic symbols
$locale['translit'] = array(
'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'ѓ' => 'g', 'ґ' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo',
'є' => 'ye', 'ж' => 'zh', 'з' => 'z', 's' => 'z', 'и' => 'i', 'й' => 'j', 'j' => 'j', 'i' => 'i', 'ї' => 'yi',
'є' => 'ye', 'ж' => 'zh', 'з' => 'z', 's' => 's', 'и' => 'i', 'й' => 'j', 'j' => 'j', 'i' => 'i', 'ї' => 'yi',
'к' => 'k', 'ќ' => 'k', 'л' => 'l', 'љ' => 'lj', 'м' => 'm', 'н' => 'n', 'њ' => 'nj', 'о' => 'o', 'п' => 'p',
'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ў' => 'u', 'ф' => 'f', 'х' => 'kh', 'ц' => 'cz', 'ч' => 'ch',
'џ' => 'dh', 'ш' => 'sh', 'щ' => 'shh', 'ъ' => '', 'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya',
Expand Down
2 changes: 1 addition & 1 deletion engine/lib/external/UserLocale/i18n/ru.php
Expand Up @@ -15,7 +15,7 @@
// All cyrillic symbols
$locale['translit'] = array(
'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'ѓ' => 'g', 'ґ' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo',
'є' => 'ye', 'ж' => 'zh', 'з' => 'z', 's' => 'z', 'и' => 'i', 'й' => 'j', 'j' => 'j', 'i' => 'i', 'ї' => 'yi',
'є' => 'ye', 'ж' => 'zh', 'з' => 'z', 's' => 's', 'и' => 'i', 'й' => 'j', 'j' => 'j', 'i' => 'i', 'ї' => 'yi',
'к' => 'k', 'ќ' => 'k', 'л' => 'l', 'љ' => 'lj', 'м' => 'm', 'н' => 'n', 'њ' => 'nj', 'о' => 'o', 'п' => 'p',
'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ў' => 'u', 'ф' => 'f', 'х' => 'kh', 'ц' => 'cz', 'ч' => 'ch',
'џ' => 'dh', 'ш' => 'sh', 'щ' => 'shh', 'ъ' => '', 'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya',
Expand Down

0 comments on commit 247bb9a

Please sign in to comment.