yaroslawww /
laravel-i18n-strings-batch
| 1 | <?php |
||
| 2 | |||
| 3 | if (! function_exists('i18n_strings_batch')) { |
||
| 4 | /** |
||
| 5 | * Get translations batch. |
||
| 6 | * |
||
| 7 | * @param string|array $keys |
||
| 8 | * @param string|null $locale |
||
| 9 | * |
||
| 10 | * @return array |
||
| 11 | */ |
||
| 12 | function i18n_strings_batch(string|array $keys, ?string $locale = null): array |
||
| 13 | { |
||
| 14 | return \I18nStringsBatch\Facades\I18nStringsBatch::setLocale($locale)->getBatch($keys); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 15 | |||
| 16 | } |
||
| 17 | } |
||
| 18 | |||
| 19 | if (! function_exists('i18n_strings_batch_json')) { |
||
| 20 | /** |
||
| 21 | * Get translations batch encoded in json. |
||
| 22 | * |
||
| 23 | * @param string|array $keys |
||
| 24 | * @param string|null $locale |
||
| 25 | * @return string |
||
| 26 | */ |
||
| 27 | function i18n_strings_batch_json(string|array $keys, ?string $locale = null): string |
||
| 28 | { |
||
| 29 | return \I18nStringsBatch\Facades\I18nStringsBatch::setLocale($locale)->getBatchJson($keys); |
||
| 30 | } |
||
| 31 | } |
||
| 32 |