Skip to content

Commit 868d034

Browse files
authored
Add basic translation guide, fix some PHP issues elsewhere
2 parents 606c6fb + 99d5654 commit 868d034

6 files changed

Lines changed: 866 additions & 16 deletions

File tree

api-reference/translate.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ print(result.text) # "Bonjour, le monde !"
110110
<Tab title="PHP">
111111
```php Example request: text translation (without glossary)
112112
$authKey = "f63c02c5-f056-..."; // Replace with your key
113-
$deeplClient = new \DeepL\DeepLClient($authKey);
113+
$deeplClient = new DeepL\DeepLClient($authKey);
114114

115115
$result = $deeplClient->translateText('Hello, world!', null, 'fr');
116116
echo $result->text; // Bonjour, le monde!

docs.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@
7272
{
7373
"group": "Guides",
7474
"pages": [
75-
"docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter",
76-
"docs/learning-how-tos/examples-and-guides/placeholder-tags",
7775
"docs/learning-how-tos/examples-and-guides/first-things-to-try-with-the-deepl-api",
76+
"docs/learning-how-tos/examples-and-guides/translation-beginners-guide",
77+
"docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter",
78+
"docs/learning-how-tos/examples-and-guides/translating-between-variants",
7879
"docs/learning-how-tos/examples-and-guides/glossaries-in-the-real-world",
79-
"docs/learning-how-tos/examples-and-guides/deepl-mcp-server-how-to-build-and-use-translation-in-llm-applications",
80-
"docs/learning-how-tos/examples-and-guides/translating-between-variants"
80+
"docs/learning-how-tos/examples-and-guides/placeholder-tags",
81+
"docs/learning-how-tos/examples-and-guides/deepl-mcp-server-how-to-build-and-use-translation-in-llm-applications"
8182
]
8283
}
8384
]

docs/getting-started/intro.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ New user? Follow these quick steps to get started with the DeepL API.
142142

143143
```php Sample request
144144
require_once 'vendor/autoload.php';
145-
use DeepL\Translator;
145+
use DeepL\Client;
146146

147147
$authKey = "{YOUR_API_KEY}"; // replace with your key
148-
$deeplClient = new \DeepL\DeepLClient($authKey);
148+
$deeplClient = new DeepL\DeepLClient($authKey);
149149

150150
$result = $deeplClient->translateText('Hello, world!', null, 'de');
151151
echo $result->text;

docs/getting-started/your-first-api-request.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ We included text translation examples for our [client libraries](/docs/getting-s
104104
<Tab title="PHP">
105105
```php
106106
require_once 'vendor/autoload.php';
107-
use DeepL\Translator;
107+
use DeepL\Client;
108108

109109
$authKey = "f63c02c5-f056-..."; // Replace with your key
110-
$deeplClient = new \DeepL\DeepLClient($authKey);
110+
$deeplClient = new DeepL\DeepLClient($authKey);
111111

112112
$result = $deeplClient->translateText('Hello, world!', null, 'fr');
113113
echo $result->text; // Bonjour, le monde!

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,21 @@ description: "Learn how to use DeepL API features to achieve your translation g
55
public: true
66
---
77
<CardGroup cols={2}>
8-
<Card title="Mustache placeholder tags" horizontal href="/docs/learning-how-tos/examples-and-guides/placeholder-tags">
9-
10-
</Card>
118
<Card title="DeepL API 101" horizontal href="/docs/learning-how-tos/examples-and-guides/first-things-to-try-with-the-deepl-api">
12-
9+
</Card>
10+
<Card title="Translation: a beginner's guide" horizontal href="/docs/learning-how-tos/examples-and-guides/translation-beginners-guide">
11+
</Card>
12+
<Card title="Mustache placeholder tags" horizontal href="/docs/learning-how-tos/examples-and-guides/placeholder-tags">
1313
</Card>
1414
<Card title="Glossaries in the real world" horizontal href="/docs/learning-how-tos/examples-and-guides/glossaries-in-the-real-world">
15-
1615
</Card>
1716
<Card title="DeepL MCP Server: How to Build and Use Translation in LLM Applications" horizontal href="/docs/learning-how-tos/examples-and-guides/deepl-mcp-server-how-to-build-and-use-translation-in-llm-applications">
1817

1918
Written by [Akash Joshi](https://thewriting.dev)
2019

2120
</Card>
2221
<Card title="How to Use the Context Parameter Effectively" horizontal href="/docs/learning-how-tos/examples-and-guides/how-to-use-context-parameter">
23-
2422
</Card>
2523
<Card title="How to Translate Between Language Variants" horizontal href="/docs/learning-how-tos/examples-and-guides/translating-between-variants">
26-
2724
</Card>
2825
</CardGroup>

0 commit comments

Comments
 (0)