@@ -10,7 +10,7 @@ |
||
| 10 | 10 | $config['gettext_locale_dir'] = 'language/locale'; |
| 11 | 11 | |
| 12 | 12 | // Gettext locale |
| 13 | -$config['gettext_locale'] = Array( "en_GB.UTF-8", "en_GB@euro", "en_GB", "english", "eng", "en"); |
|
| 13 | +$config['gettext_locale'] = Array("en_GB.UTF-8", "en_GB@euro", "en_GB", "english", "eng", "en"); |
|
| 14 | 14 | |
| 15 | 15 | /* End of file gettext.php */ |
| 16 | 16 | /* Location: ./application/config/gettext.php */ |
| 17 | 17 | \ No newline at end of file |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | // Gettext catalog codeset |
| 4 | 6 | $config['gettext_catalog_codeset'] = 'UTF-8'; |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | /** |
| 4 | 6 | * Codeigniter PHP framework library class for dealing with gettext. |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $CI = &get_instance(); |
| 23 | 23 | |
| 24 | 24 | // Merge $config and config/gettext.php $config |
| 25 | - $config = array_merge ( |
|
| 25 | + $config = array_merge( |
|
| 26 | 26 | array( |
| 27 | 27 | 'gettext_locale_dir' => $CI->config->item('gettext_locale_dir'), |
| 28 | 28 | 'gettext_text_domain' => $CI->config->item('gettext_text_domain'), |
@@ -33,59 +33,59 @@ discard block |
||
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | // Gettext catalog codeset |
| 36 | - $IsBindTextDomainCodeset = bind_textdomain_codeset ( |
|
| 36 | + $IsBindTextDomainCodeset = bind_textdomain_codeset( |
|
| 37 | 37 | $config['gettext_text_domain'], |
| 38 | 38 | $config['gettext_catalog_codeset'] |
| 39 | 39 | ); |
| 40 | 40 | |
| 41 | - log_message ( |
|
| 41 | + log_message( |
|
| 42 | 42 | 'info', |
| 43 | 43 | 'Try to bind gettext catalog_codeset: ' . $config['gettext_catalog_codeset'] . " - " . |
| 44 | 44 | ($IsBindTextDomainCodeset ? 'Successful' : '*** FAILED ***') |
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | // Path to gettext locales directory relative to FCPATH.APPPATH |
| 48 | - $IsBindTextDomain = bindtextdomain ( |
|
| 48 | + $IsBindTextDomain = bindtextdomain( |
|
| 49 | 49 | $config['gettext_text_domain'], |
| 50 | 50 | APPPATH . $config['gettext_locale_dir'] |
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | - log_message ( |
|
| 53 | + log_message( |
|
| 54 | 54 | 'info', |
| 55 | - 'Try to bind gettext text domain (locale dir): ' . (empty($IsBindTextDomain) ? $IsBindTextDomain : APPPATH.$config['gettext_locale_dir'] ) . " - " . |
|
| 55 | + 'Try to bind gettext text domain (locale dir): ' . (empty($IsBindTextDomain) ? $IsBindTextDomain : APPPATH . $config['gettext_locale_dir']) . " - " . |
|
| 56 | 56 | (isset($IsBindTextDomain) ? 'Successful' : '*** FAILED ***') |
| 57 | 57 | ); |
| 58 | 58 | |
| 59 | 59 | // Gettext domain |
| 60 | - $IsSetTextDomain = textdomain ( |
|
| 60 | + $IsSetTextDomain = textdomain( |
|
| 61 | 61 | $config['gettext_text_domain'] |
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | - log_message ( |
|
| 64 | + log_message( |
|
| 65 | 65 | 'info', |
| 66 | - 'Try to set gettext text_domain: '.$config['gettext_text_domain'] . " - " . |
|
| 66 | + 'Try to set gettext text_domain: ' . $config['gettext_text_domain'] . " - " . |
|
| 67 | 67 | ($IsSetTextDomain ? 'Successful' : '*** FAILED ***') |
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | 70 | // Gettext locale |
| 71 | - $IsSetLocale = setlocale ( |
|
| 71 | + $IsSetLocale = setlocale( |
|
| 72 | 72 | LC_ALL, |
| 73 | 73 | $config['gettext_locale'] |
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | - log_message ( |
|
| 76 | + log_message( |
|
| 77 | 77 | 'info', |
| 78 | - 'Try to set gettext locale: '.(is_array($config['gettext_locale']) ? print_r($config['gettext_locale'],TRUE) : $config['gettext_locale']) . " - " . |
|
| 78 | + 'Try to set gettext locale: ' . (is_array($config['gettext_locale']) ? print_r($config['gettext_locale'], TRUE) : $config['gettext_locale']) . " - " . |
|
| 79 | 79 | ($IsSetLocale ? 'Successful' : '*** FAILED ***') |
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | 82 | // Change environment language for CLI |
| 83 | 83 | $IsPutEnv = putenv('LANGUAGE=' . (is_array($config['gettext_locale']) ? $config['gettext_locale'][0] : $config['gettext_locale'])); |
| 84 | 84 | |
| 85 | - log_message ( |
|
| 85 | + log_message( |
|
| 86 | 86 | 'info', |
| 87 | 87 | 'Try to set Environment LANGUAGE: ' . (is_array($config['gettext_locale']) ? $config['gettext_locale'][0] : $config['gettext_locale']) . " - " . |
| 88 | - ( $IsPutEnv ? 'Successful' : '*** FAILED ***') |
|
| 88 | + ($IsPutEnv ? 'Successful' : '*** FAILED ***') |
|
| 89 | 89 | ); |
| 90 | 90 | } |
| 91 | 91 | } |