@@ -119,6 +119,9 @@ discard block |
||
| 119 | 119 | return $config; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | + /** |
|
| 123 | + * @param string $key |
|
| 124 | + */ |
|
| 122 | 125 | public function getConfig($key = null) |
| 123 | 126 | { |
| 124 | 127 | if ($key === null) { |
@@ -132,7 +135,6 @@ discard block |
||
| 132 | 135 | * Set locale and load texts |
| 133 | 136 | * |
| 134 | 137 | * @param string $lang |
| 135 | - * @param string $default_lang |
|
| 136 | 138 | * @param array $texts |
| 137 | 139 | * @return void |
| 138 | 140 | */ |
@@ -210,7 +212,7 @@ discard block |
||
| 210 | 212 | /** |
| 211 | 213 | * Get texts |
| 212 | 214 | * |
| 213 | - * @return array |
|
| 215 | + * @return string|null |
|
| 214 | 216 | */ |
| 215 | 217 | public function getRedirectUrl(Request $request) |
| 216 | 218 | { |
@@ -313,6 +315,9 @@ discard block |
||
| 313 | 315 | return $this; |
| 314 | 316 | } |
| 315 | 317 | |
| 318 | + /** |
|
| 319 | + * @param string|null $lang |
|
| 320 | + */ |
|
| 316 | 321 | public function loadTextsFromDatabase($lang) |
| 317 | 322 | { |
| 318 | 323 | $texts = $lang ? $this->db->table($this->getTableName()) |
@@ -333,6 +338,9 @@ discard block |
||
| 333 | 338 | return $texts; |
| 334 | 339 | } |
| 335 | 340 | |
| 341 | + /** |
|
| 342 | + * @param string $lang |
|
| 343 | + */ |
|
| 336 | 344 | public function setCacheName($lang) |
| 337 | 345 | { |
| 338 | 346 | $this->cache_name = $this->getConfig('texts_table') . '_' . $lang; |
@@ -245,7 +245,7 @@ |
||
| 245 | 245 | |
| 246 | 246 | public function detectLocale(Request $request) |
| 247 | 247 | { |
| 248 | - $locale = $request->segment(1); |
|
| 248 | + $locale = $request->segment(1); |
|
| 249 | 249 | $locales = $this->getConfig('locales'); |
| 250 | 250 | |
| 251 | 251 | if (isset($locales[$locale])) { |