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

Commit 21c4ca3

Browse files
author
Jay Trees
committed
Auto detect input language as default
1 parent d254873 commit 21c4ca3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ foreach ($translations as $translation) {
6565
| param | Description |
6666
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
6767
| $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. |
68-
| $sourceLang | Language of the text to be translated. <br>default: de |
68+
| $sourceLang | Language of the text to be translated. <br>default: "" (DeepL will auto-detect) |
6969
| $targetLang | The language into which the text should be translated. <br> default: en |
7070
| $tagHandling | Sets which kind of tags should be handled. Options currently available: "xml" |
7171
| $ignoreTags | Array of XML tags that indicate text not to be translated. <br> default: null |
@@ -110,7 +110,7 @@ You can now check how much you translate, as well as the limit:
110110
$usageArray = $deepl->usage();
111111

112112
echo 'You have used '.$usageArray['character_count'].' of '.$usageArray['character_limit'].' in the current billing period.'.PHP_EOL;
113-
113+
114114
```
115115

116116
### Glossary

src/DeepL.php

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

0 commit comments

Comments
 (0)