@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @param array $config |
| 81 | 81 | * @param \Illuminate\Cache\CacheManager $cache |
| 82 | 82 | * @param \Illuminate\Database\DatabaseManager $db |
| 83 | - * @return void |
|
| 83 | + * @return string |
|
| 84 | 84 | */ |
| 85 | 85 | public function __construct($environment, array $config, CacheContract $cache, DatabaseContract $db) |
| 86 | 86 | { |
@@ -113,6 +113,9 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | + /** |
|
| 117 | + * @param string $key |
|
| 118 | + */ |
|
| 116 | 119 | public function getConfig($key = null) |
| 117 | 120 | { |
| 118 | 121 | if ($key === null) { |
@@ -126,7 +129,7 @@ discard block |
||
| 126 | 129 | * Set locale and load texts |
| 127 | 130 | * |
| 128 | 131 | * @param string $lang |
| 129 | - * @param array $text |
|
| 132 | + * @param array $texts |
|
| 130 | 133 | * @return void |
| 131 | 134 | */ |
| 132 | 135 | public function setLocale($lang, $texts = null) |
@@ -178,7 +181,6 @@ discard block |
||
| 178 | 181 | * Get translated text |
| 179 | 182 | * |
| 180 | 183 | * @param string $key |
| 181 | - * @param string $default |
|
| 182 | 184 | * @return string |
| 183 | 185 | */ |
| 184 | 186 | public function get($key) |
@@ -259,6 +261,9 @@ discard block |
||
| 259 | 261 | return $status; |
| 260 | 262 | } |
| 261 | 263 | |
| 264 | + /** |
|
| 265 | + * @param string|null $lang |
|
| 266 | + */ |
|
| 262 | 267 | public function loadTextsFromDatabase($lang) |
| 263 | 268 | { |
| 264 | 269 | $texts = $lang ? $this->db->table($this->getTableName()) |
@@ -279,6 +284,9 @@ discard block |
||
| 279 | 284 | return $texts; |
| 280 | 285 | } |
| 281 | 286 | |
| 287 | + /** |
|
| 288 | + * @param string $lang |
|
| 289 | + */ |
|
| 282 | 290 | public function setCacheName($lang) |
| 283 | 291 | { |
| 284 | 292 | $this->cache_name = $this->getConfig('texts_table') . '_' . $lang; |