@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $translations = array(); |
25 | 25 | if (file_exists($absoluteTranslationFileName)) { |
26 | 26 | @include($absoluteTranslationFileName); |
27 | - } else { |
|
27 | + }else { |
|
28 | 28 | Cache::getInstance()->storeData($absoluteTranslationFileName, "<?php \$translations = array();\n", Cache::TEXT, TRUE); |
29 | 29 | } |
30 | 30 | |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public static function setLocale() { |
38 | 38 | $locale = Config::getParam("default.language", 'es_ES'); |
39 | - Logger::log('Set locale to project [' . $locale . ']'); |
|
39 | + Logger::log('Set locale to project ['.$locale.']'); |
|
40 | 40 | // Load translations |
41 | - putenv("LC_ALL=" . $locale); |
|
41 | + putenv("LC_ALL=".$locale); |
|
42 | 42 | setlocale(LC_ALL, $locale); |
43 | 43 | // Load the locale path |
44 | - $locale_path = BASE_DIR . DIRECTORY_SEPARATOR . 'locale'; |
|
45 | - Logger::log('Set locale dir ' . $locale_path); |
|
44 | + $locale_path = BASE_DIR.DIRECTORY_SEPARATOR.'locale'; |
|
45 | + Logger::log('Set locale dir '.$locale_path); |
|
46 | 46 | GeneratorHelper::createDir($locale_path); |
47 | 47 | bindtextdomain('translations', $locale_path); |
48 | 48 | textdomain('translations'); |
@@ -54,17 +54,17 @@ discard block |
||
54 | 54 | * @return string |
55 | 55 | */ |
56 | 56 | public static function utf8Encode($data) { |
57 | - if(is_array($data)) { |
|
58 | - foreach($data as $key => &$field) { |
|
57 | + if (is_array($data)) { |
|
58 | + foreach ($data as $key => &$field) { |
|
59 | 59 | $field = self::utf8Encode($field); |
60 | 60 | } |
61 | - } elseif(is_object($data)) { |
|
61 | + } elseif (is_object($data)) { |
|
62 | 62 | $properties = get_class_vars($data); |
63 | - foreach($properties as $property => $value) { |
|
63 | + foreach ($properties as $property => $value) { |
|
64 | 64 | $data->$property = self::utf8Encode($data->$property); |
65 | 65 | } |
66 | 66 | |
67 | - } elseif(is_string($data)) { |
|
67 | + } elseif (is_string($data)) { |
|
68 | 68 | $data = utf8_encode($data); |
69 | 69 | } |
70 | 70 | return $data; |
@@ -21,8 +21,8 @@ |
||
21 | 21 | { |
22 | 22 | $response = I18nHelper::utf8Encode($response); |
23 | 23 | $data = json_encode($response, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK); |
24 | - if(Config::getParam('angular.protection', false)) { |
|
25 | - $data = ")]}',\n" . $data; |
|
24 | + if (Config::getParam('angular.protection', false)) { |
|
25 | + $data = ")]}',\n".$data; |
|
26 | 26 | } |
27 | 27 | $this->setStatus($statusCode); |
28 | 28 | return $this->output($data, "application/json"); |