Completed
Push — master ( 13192d...abaac9 )
by Mihail
03:13
created
src/Ffcms/Core/I18n/Translate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
         if (Obj::isArray($params) && count($params) > 0) {
56 56
             foreach ($params as $var => $value) {
57
-                $text = Str::replace('%' . $var . '%', $value, $text);
57
+                $text = Str::replace('%'.$var.'%', $value, $text);
58 58
             }
59 59
         }
60 60
         return $text;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function translate($text, array $params = [])
70 70
     {
71 71
         $index = null;
72
-        $namespace = 'Apps\Controller\\' . env_name . '\\';
72
+        $namespace = 'Apps\Controller\\'.env_name.'\\';
73 73
         foreach (@debug_backtrace() as $caller) {
74 74
             if (isset($caller['class']) && Str::startsWith($namespace, $caller['class'])) {
75 75
                 $index = Str::sub((string)$caller['class'], Str::length($namespace));
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     protected function load($index)
87 87
     {
88
-        $file = root . '/I18n/' . env_name . '/' . App::$Request->getLanguage() . '/' . $index . '.php';
88
+        $file = root.'/I18n/'.env_name.'/'.App::$Request->getLanguage().'/'.$index.'.php';
89 89
         if (!File::exist($file)) {
90 90
             return [];
91 91
         }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function getAvailableLangs()
124 124
     {
125 125
         $langs = ['en'];
126
-        $scan = Directory::scan(root . '/I18n/' . env_name . '/', GLOB_ONLYDIR, true);
126
+        $scan = Directory::scan(root.'/I18n/'.env_name.'/', GLOB_ONLYDIR, true);
127 127
         foreach ($scan as $row) {
128 128
             $langs[] = trim($row, '/');
129 129
         }
Please login to merge, or discard this patch.