Skip to content

Commit 7d8a3b6

Browse files
authored
Upgrade tanmuhittin/laravel-google-translate (#366)
* upgrade laravel-google-translate * fix method name * use withAttributes method
1 parent 3c154d8 commit 7d8a3b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"illuminate/support": "^5.5|^6|^7",
1919
"illuminate/translation": "^5.5|^6|^7",
2020
"symfony/finder": "^3|^4|^5",
21-
"tanmuhittin/laravel-google-translate": "^1.0.2"
21+
"tanmuhittin/laravel-google-translate": "^2.0.1"
2222
},
2323
"autoload": {
2424
"psr-4": {

src/Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Illuminate\Routing\Controller as BaseController;
55
use Barryvdh\TranslationManager\Models\Translation;
66
use Illuminate\Support\Collection;
7-
use Tanmuhittin\LaravelGoogleTranslate\Commands\TranslateFilesCommand;
7+
use Illuminate\Support\Str;
88

99
class Controller extends BaseController
1010
{
@@ -184,7 +184,7 @@ public function postTranslateMissing(Request $request){
184184
// Translation already exists. Skip
185185
continue;
186186
}
187-
$translated_text = TranslateFilesCommand::translate($base_locale, $newLocale, $base_string->value);
187+
$translated_text = Str::apiTranslateWithAttributes($base_string->value, $newLocale, $base_locale);
188188
request()->replace([
189189
'value' => $translated_text,
190190
'name' => $newLocale . '|' . $base_string->key,

0 commit comments

Comments
 (0)