Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit bc3cb94

Browse files
authored
Merge pull request #33 from grandeljay/detect-language-as-default
Auto detect input language as default
2 parents e6e35ff + 21c4ca3 commit bc3cb94

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ foreach ($translations as $translation) {
6969
| param | Description |
7070
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
7171
| $text | Text to be translated. Only UTF8-encoded plain text is supported. The parameter may be specified as an Array and translations are returned in the same order as they are requested. Each of the array values may contain multiple sentences. Up to 50 texts can be sent for translation in one request. |
72-
| $sourceLang | Language of the text to be translated. <br>default: de |
72+
| $sourceLang | Language of the text to be translated. <br>default: "" (DeepL will auto-detect) |
7373
| $targetLang | The language into which the text should be translated. <br> default: en |
7474
| $tagHandling | Sets which kind of tags should be handled. Options currently available: "xml" |
7575
| $ignoreTags | Array of XML tags that indicate text not to be translated. <br> default: null |

src/DeepL.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function languages($type = null)
7474
*/
7575
public function translate(
7676
$text,
77-
$sourceLang = 'de',
77+
$sourceLang = '',
7878
$targetLang = 'en',
7979
$tagHandling = null,
8080
array $ignoreTags = null,

0 commit comments

Comments
 (0)