@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | public $error = 0; |
41 | 41 | |
42 | 42 | //private: |
43 | - private $pluralheader = NULL; // cache header field for plural forms |
|
44 | - private $cache_translations = array(); // original -> translation mapping |
|
43 | + private $pluralheader = NULL; // cache header field for plural forms |
|
44 | + private $cache_translations = array(); // original -> translation mapping |
|
45 | 45 | |
46 | 46 | |
47 | 47 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function __construct($filename) |
53 | 53 | { |
54 | - if (! is_readable($filename)) { |
|
54 | + if (!is_readable($filename)) { |
|
55 | 55 | $this->error = 2; // file does not exist |
56 | 56 | return; |
57 | 57 | } |
@@ -128,16 +128,16 @@ discard block |
||
128 | 128 | $res .= ') : ('; |
129 | 129 | break; |
130 | 130 | case ';': |
131 | - $res .= str_repeat( ')', $p) . ';'; |
|
131 | + $res .= str_repeat(')', $p) . ';'; |
|
132 | 132 | $p = 0; |
133 | 133 | break; |
134 | 134 | default: |
135 | 135 | $res .= $ch; |
136 | 136 | } |
137 | 137 | } |
138 | - $res = str_replace('nplurals','$total',$res); |
|
139 | - $res = str_replace('n','$n',$res); |
|
140 | - $res = str_replace('plural','$plural',$res); |
|
138 | + $res = str_replace('nplurals', '$total', $res); |
|
139 | + $res = str_replace('n', '$n', $res); |
|
140 | + $res = str_replace('plural', '$plural', $res); |
|
141 | 141 | return $res; |
142 | 142 | } |
143 | 143 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | { |
211 | 211 | // this should contains all strings separated by NULLs |
212 | 212 | $key = $single . chr(0) . $plural; |
213 | - if (! array_key_exists($key, $this->cache_translations)) { |
|
213 | + if (!array_key_exists($key, $this->cache_translations)) { |
|
214 | 214 | return ($number != 1) ? $plural : $single; |
215 | 215 | } |
216 | 216 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | // LC_MESSAGES is not available if php-gettext is not loaded |
36 | 36 | // while the other constants are already available from session extension. |
37 | 37 | if (!defined('LC_MESSAGES')) { |
38 | - define('LC_MESSAGES', 5); |
|
38 | + define('LC_MESSAGES', 5); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | if (preg_match("/^(?P<lang>[a-z]{2,3})" // language code |
75 | 75 | ."(?:_(?P<country>[A-Z]{2}))?" // country code |
76 | 76 | ."(?:\.(?P<charset>[-A-Za-z0-9_]+))?" // charset |
77 | - ."(?:@(?P<modifier>[-A-Za-z0-9_]+))?$/", // @ modifier |
|
77 | + ."(?:@(?P<modifier>[-A-Za-z0-9_]+))?$/", // @ modifier |
|
78 | 78 | $locale, $matches)) { |
79 | 79 | |
80 | 80 | if (isset($matches["lang"])) $lang = $matches["lang"]; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | /** |
111 | 111 | * Utility function to get a StreamReader for the given text domain. |
112 | 112 | */ |
113 | -function _get_reader($domain=null, $category=5) { |
|
113 | +function _get_reader($domain = null, $category = 5) { |
|
114 | 114 | global $text_domains, $default_domain, $LC_CATEGORIES; |
115 | 115 | if (!isset($domain)) $domain = $default_domain; |
116 | 116 | if (!isset($text_domains[$domain]->l10n)) { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $locale = _setlocale(LC_MESSAGES, 0); |
119 | 119 | $bound_path = isset($text_domains[$domain]->path) ? |
120 | 120 | $text_domains[$domain]->path : './'; |
121 | - $subpath = $LC_CATEGORIES[$category] ."/$domain.mo"; |
|
121 | + $subpath = $LC_CATEGORIES[$category] . "/$domain.mo"; |
|
122 | 122 | |
123 | 123 | $locale_names = get_list_of_locales($locale); |
124 | 124 | $input = null; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * Checks if the current locale is supported on this system. |
152 | 152 | */ |
153 | -function _check_locale_and_function($function=false) { |
|
153 | +function _check_locale_and_function($function = false) { |
|
154 | 154 | global $EMULATEGETTEXT; |
155 | 155 | if ($function and !function_exists($function)) |
156 | 156 | return false; |
@@ -160,10 +160,10 @@ discard block |
||
160 | 160 | /** |
161 | 161 | * Get the codeset for the given domain. |
162 | 162 | */ |
163 | -function _get_codeset($domain=null) { |
|
163 | +function _get_codeset($domain = null) { |
|
164 | 164 | global $text_domains, $default_domain, $LC_CATEGORIES; |
165 | 165 | if (!isset($domain)) $domain = $default_domain; |
166 | - return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding'); |
|
166 | + return (isset($text_domains[$domain]->codeset)) ? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding'); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -241,10 +241,10 @@ discard block |
||
241 | 241 | global $text_domains; |
242 | 242 | // ensure $path ends with a slash ('/' should work for both, but lets still play nice) |
243 | 243 | if (DIRECTORY_SEPARATOR == '\\') { |
244 | - if ($path[strlen($path)-1] != '\\' and $path[strlen($path)-1] != '/') |
|
244 | + if ($path[strlen($path) - 1] != '\\' and $path[strlen($path) - 1] != '/') |
|
245 | 245 | $path .= '\\'; |
246 | 246 | } else { |
247 | - if ($path[strlen($path)-1] != '/') |
|
247 | + if ($path[strlen($path) - 1] != '/') |
|
248 | 248 | $path .= '/'; |
249 | 249 | } |
250 | 250 | if (!array_key_exists($domain, $text_domains)) { |