Skip to content

Commit

Permalink
make contao sub languages compatible with deepl languages
Browse files Browse the repository at this point in the history
  • Loading branch information
gebi84 committed Feb 3, 2025
1 parent 4e26b87 commit 4fde411
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Api/DeeplApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public function __construct(string $deeplApiKey, Config $config)

public function translate(string $text, string $sourceLang, string $targetLang)
{
$sourceLang = str_replace('_', '-', strtoupper($sourceLang));
$targetLang = str_replace('_', '-', strtoupper($targetLang));

$response = $this->client->post(
'/v2/translate',
[
Expand Down

0 comments on commit 4fde411

Please sign in to comment.