Skip to content

Commit f5d97e9

Browse files
committed
A few small fixes
Fixed link in examples-and-guides.mdx Card Rewrote translation example Added `require_once` statements into all PHP examples
1 parent 4d40dfd commit f5d97e9

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

docs/learning-how-tos/examples-and-guides.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public: true
77
<CardGroup cols={2}>
88
<Card title="DeepL API 101" horizontal href="/docs/learning-how-tos/examples-and-guides/first-things-to-try-with-the-deepl-api">
99
</Card>
10-
<Card title="Translation: a beginner's guide" horizontal href="/docs/learning-how-tos/examples-and-guides/placeholder-tags">
10+
<Card title="Translation: a beginner's guide" horizontal href="/docs/learning-how-tos/examples-and-guides/translation-beginners-guide">
1111
</Card>
1212
<Card title="Mustache placeholder tags" horizontal href="/docs/learning-how-tos/examples-and-guides/placeholder-tags">
1313
</Card>

docs/learning-how-tos/examples-and-guides/translation-beginners-guide.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ That’s all you need! Since DeepL is quite good at detecting the source languag
6666

6767
### A sample translation request
6868

69-
For example, if you wanted to translate the phrase “Hello, bright universe!” from German to Japanese:
69+
For example, if you wanted to translate the phrase “Hello, bright universe!” to Japanese:
7070

71-
* “Hello, everybody” is the `text`
72-
* German is the `source_lang`
71+
* “Hello, bright universe!” is the `text`
7372
* Japanese is the `target_lang`
73+
* the source language is English, so you could include this as the `source_lang`, but you don't need to.
7474

7575
The first tab below shows the HTTP request you’d use here and a typical response from the API. Other tabs show how you’d make this request [using cURL](https://curl.se/docs/tooldocs.html) and using our official client libraries. To see how you’d handle the response in your favorite programming language, check the appropriate tab.
7676

@@ -174,6 +174,7 @@ The first tab below shows the HTTP request you’d use here and a typical respon
174174
</Tab>
175175
<Tab title="PHP">
176176
```php Sample request
177+
require_once 'vendor/autoload.php';
177178
use DeepL\Client;
178179

179180
$authKey = "{YOUR_API_KEY}"; // replace with your key
@@ -395,6 +396,7 @@ If you look at the HTTP request above, you’ll notice that the translation text
395396
</Tab>
396397
<Tab title="PHP">
397398
```php Sample request
399+
require_once 'vendor/autoload.php';
398400
use DeepL\Client;
399401

400402
$authKey = "{YOUR_API_KEY}"; // replace with your key
@@ -652,6 +654,7 @@ In fact, these text strings can be in different languages. If you don’t set th
652654
</Tab>
653655
<Tab title="PHP">
654656
```php Sample request
657+
require_once 'vendor/autoload.php';
655658
use DeepL\Client;
656659

657660
$authKey = "{YOUR_API_KEY}"; // replace with your key

0 commit comments

Comments
 (0)