Skip to content

Commit 6e4622b

Browse files
committed
Update translator configuration and helper function
1 parent 72a79e9 commit 6e4622b

File tree

4 files changed

+4
-24
lines changed

4 files changed

+4
-24
lines changed

config/translator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
'nlpCloud' => [
99
'api_key' => env('NLPCLOUD_API_KEY'),
1010
'languages' => [
11-
'az' => 'azb_Arab',
1211
'az' => 'azj_Latn',
1312
'de' => 'deu_Latn',
1413
'en' => 'eng_Latn',

src/Facades/LaravelTranslator.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,7 @@
77
/**
88
* @see \Ferdiunal\LaravelTranslator\LaravelTranslator
99
*
10-
* @phpstan-type Translators array{
11-
* google: \Ferdiunal\LaravelTranslator\Translators\GoogleTranslator,
12-
* bing: \Ferdiunal\LaravelTranslator\Translators\BingTranslator,
13-
* deepl: \Ferdiunal\LaravelTranslator\Translators\DeepLTranslator,
14-
* myMemory: \Ferdiunal\LaravelTranslator\Translators\MyMemoryTranslator,
15-
* nlpCloud: \Ferdiunal\LaravelTranslator\Translators\NLPCloudTranslator,
16-
* }
17-
*
18-
* @template T of key-of<Translators>
19-
*
20-
* @param T $translator
21-
*
10+
* @param 'google'|'bing'|'deepl'|'myMemory'|'nlpCloud' $translator
2211
* @method static string translate(string $translator, string $source, string $target, string $text): string
2312
*/
2413
class LaravelTranslator extends Facade

src/LaravelTranslator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class LaravelTranslator
2121
* @template T of key-of<Translators>
2222
*
2323
* @param T $translator
24+
* @return string
2425
*/
2526
public static function translate(string $translator, string $source, string $target, string $text): string
2627
{

src/helpers.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,8 @@
99
*
1010
* @see \Ferdiunal\LaravelTranslator\LaravelTranslator
1111
*
12-
* @phpstan-type Translators array{
13-
* google: \Ferdiunal\LaravelTranslator\Translators\GoogleTranslator,
14-
* bing: \Ferdiunal\LaravelTranslator\Translators\BingTranslator,
15-
* deepl: \Ferdiunal\LaravelTranslator\Translators\DeepLTranslator,
16-
* myMemory: \Ferdiunal\LaravelTranslator\Translators\MyMemoryTranslator,
17-
* nlpCloud: \Ferdiunal\LaravelTranslator\Translators\NLPCloudTranslator,
18-
* }
19-
*
20-
* @template T of key-of<Translators>
21-
*
22-
* @param T $translator
12+
* @param 'google'|'bing'|'deepl'|'myMemory'|'nlpCloud' $translator
13+
* @return string
2314
*/
2415
function translator(string $translator, string $source, string $target, string $text): string
2516
{

0 commit comments

Comments
 (0)