@@ -28,12 +28,16 @@ composer require babymarkt/deepl-php-lib
28
28
Create an instance with your auth key:
29
29
30
30
``` php
31
+ use \BabyMarkt\DeepL\DeepL;
32
+
31
33
$authKey = '<AUTH KEY >';
32
34
$deepl = new DeepL($authKey);
33
35
```
34
36
35
37
Use the DeepL API Pro:
36
38
``` php
39
+ use \BabyMarkt\DeepL\DeepL;
40
+
37
41
$authKey = '<AUTH KEY >';
38
42
$deepl = new DeepL($authKey,2,'api.deepl.com');
39
43
```
@@ -91,8 +95,8 @@ You can check for the supported Source-Languages:
91
95
``` php
92
96
$sourceLanguagesArray = $deepl->languages('source');
93
97
94
- foreach ($sourceLanguagesArray as $srouceLanguage ) {
95
- echo 'Name: '.$srouceLanguage ['name'].' Api-shorthand: '.$srouceLanguage ['language'].PHP_EOL;
98
+ foreach ($sourceLanguagesArray as $sourceLanguage ) {
99
+ echo 'Name: '.$sourceLanguage ['name'].' Api-shorthand: '.$sourceLanguage ['language'].PHP_EOL;
96
100
}
97
101
```
98
102
@@ -110,7 +114,7 @@ You can now check how much you translate, as well as the limit:
110
114
$usageArray = $deepl->usage();
111
115
112
116
echo 'You have used '.$usageArray['character_count'].' of '.$usageArray['character_limit'].' in the current billing period.'.PHP_EOL;
113
-
117
+
114
118
```
115
119
116
120
### Glossary
@@ -137,6 +141,8 @@ $glossary = $deepl->deleteGlossary($glossaryId);
137
141
138
142
List glossaries
139
143
``` php
144
+ use \BabyMarkt\DeepL\Glossary;
145
+
140
146
$glossaries = $deepl->listGlossaries();
141
147
foreach ($glossaries as $glossary) {
142
148
var_dump($glossary);
@@ -145,6 +151,8 @@ foreach ($glossaries as $glossary) {
145
151
146
152
Get glossary meta information: creation date, is glossary ready to use ...
147
153
``` php
154
+ use \BabyMarkt\DeepL\Glossary;
155
+
148
156
$glossaryInformation = $deepl->glossaryInformation($glossaryId);
149
157
var_dump($glossaryInformation);
150
158
```
0 commit comments