Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: german translation #851

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bbb0859
docs: init docs
jln13x Nov 23, 2022
89ee80f
docs: translate docker.md to german
jln13x Nov 23, 2022
67c2afd
docs: translate vercel.md to german
jln13x Nov 23, 2022
982a78d
Update www/src/pages/de/deployment/vercel.md
Coyenn Nov 24, 2022
cdb76e4
Update www/src/pages/de/deployment/docker.md
Coyenn Nov 24, 2022
c38402e
Update www/src/pages/de/deployment/docker.md
Coyenn Nov 24, 2022
f81d184
Update www/src/pages/de/deployment/docker.md
Coyenn Nov 24, 2022
64cb5b5
Merge branch 'next' into jln/german-docs
Coyenn Nov 24, 2022
a5374ba
docs: add german to translation config
Coyenn Nov 24, 2022
d7dce53
docs: translate introduction into german
Coyenn Nov 24, 2022
a07f7db
docs: translate env-variables.md to german
jln13x Nov 24, 2022
382b57d
docs: fix typo
Coyenn Nov 24, 2022
5ddec12
Merge branch 'jln/german-docs' of github.com:jln13x/create-t3-app int…
Coyenn Nov 24, 2022
0a480ad
docs: translate first-steps.md to german
jln13x Nov 24, 2022
2c89a33
Merge branch 'jln/german-docs' of github.com:jln13x/create-t3-app int…
jln13x Nov 24, 2022
6abf9d6
docs: fix formatting with prettier
Coyenn Nov 24, 2022
4ea0000
Merge branch 'jln/german-docs' of github.com:jln13x/create-t3-app int…
Coyenn Nov 24, 2022
ac94be7
docs: fix formatting with prettier
Coyenn Nov 24, 2022
d267d00
docs: translate next-auth.md to german
jln13x Nov 24, 2022
2bb4b37
Merge branch 'jln/german-docs' of github.com:jln13x/create-t3-app int…
jln13x Nov 24, 2022
c9a229b
docs: format next-auth
jln13x Nov 26, 2022
93d9ad8
docs: translate next-js to german
jln13x Nov 26, 2022
e815dcf
docs: translate prisma.md to german
jln13x Nov 26, 2022
d83a1fb
docs: translate tailwind.md to german
jln13x Nov 27, 2022
9801dc2
docs: translate typescript.md to german
jln13x Nov 27, 2022
60f775f
docs: translate trpc.md to german
jln13x Nov 27, 2022
eb8b786
docs: translate faq.md to german
jln13x Nov 27, 2022
0141e2b
docs: translate folder-structure.md to german
jln13x Nov 27, 2022
9955024
docs: translate installation.md to german
jln13x Nov 27, 2022
53a4072
docs: translate other-recs to german
jln13x Nov 27, 2022
5cde3a3
docs: translate t3 collection to german
jln13x Nov 27, 2022
adee0a3
docs: translate why.md to german
jln13x Nov 27, 2022
6ce4858
Update www/src/pages/de/usage/typescript.md
jln13x Nov 29, 2022
104dd42
Update www/src/pages/de/introduction.md
jln13x Dec 4, 2022
368c172
docs: improve introduction translation
Coyenn Dec 5, 2022
1af8d05
docs: docker wording
jln13x Feb 1, 2023
aa890b1
docs: vercel wording
jln13x Feb 1, 2023
d100c25
docs: env variables wording
jln13x Feb 1, 2023
827682b
docs: apply suggestions
jln13x Feb 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 33 additions & 32 deletions www/src/pages/de/usage/env-variables.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Environment Variables
description: Getting started with create-t3-app
title: Umgebungsvariablen
description: Einführung in create-t3-app
layout: ../../../layouts/docs.astro
lang: en
lang: de
---

Create-T3-App uses [Zod](https://github.com/colinhacks/zod) for validating your environment variables at runtime _and_ buildtime by providing some additional files in the `env`-directory:
`create-t3-app` benutzt [Zod](https://github.com/colinhacks/zod) um deine Umgebungsvariablen zur Laufzeit _und_ zur Build Time zu validieren. Dazu werden zusätzliche Dateien im `env`-Verzeichnis bereitgestellt:

📁 src/env

Expand All @@ -15,13 +15,14 @@ Create-T3-App uses [Zod](https://github.com/colinhacks/zod) for validating your

┣ 📄 server.mjs

The content of these files may seem scary at first glance, but don't worry, it's not as complicated as it looks. Let's take a look at them one by one, and walk through the process of adding additional environment variables.

_TLDR; If you want to add a new environment variable, you must add it to both your `.env` as well as define the validator in `env/schema.mjs`._
Der Inhalt dieser Dateien mag auf den ersten Blick beängstigend sein, aber keine Sorge, es ist nicht so kompliziert wie es aussieht. Schauen wir uns diese nacheinander an und wie man zusätzliche Umgebungsvariablen hinzufügt.

_TLDR; Wenn du eine neue Umgebungsvariable hinzufügen möchtest, musst du sie sowohl in deiner `.env` als auch in `env/schema.mjs` definieren._

## schema.mjs

This is the file you will actually touch. It contains two schemas, one for server-side environment variables and one for client-side as well as a `clientEnv` object.
In dieser Datei finden die Änderungen statt. Sie enthält zwei Schemata, eines für Server-Umgebungsvariablen und eines für Client-Umgebungsvariablen sowie ein `clientEnv`-Objekt.
jln13x marked this conversation as resolved.
Show resolved Hide resolved

```ts:env/schema.mjs
export const serverSchema = z.object({
Expand All @@ -39,26 +40,26 @@ export const clientEnv = {

### Server Schema

Define your server-side environment variables schema here.
Definiere hier dein Server-Umgebungsvariablen-Schema.

Make sure you do not prefix keys here with `NEXT_PUBLIC`. Validation will fail if you do to help you detect invalid configuration.
Stell sicher, dass du hier keine Schlüssel mit dem `NEXT_PUBLIC`-Präfix verwendest. Die Validierung wird fehlschlagen, wenn du das tust, um dir bei der Erkennung einer ungültigen Konfiguration zu helfen.
jln13x marked this conversation as resolved.
Show resolved Hide resolved
jln13x marked this conversation as resolved.
Show resolved Hide resolved

### Client Schema

Define your client-side environment variables schema here.
Definiere hier dein Client-Umgebungsvariablen-Schema.

To expose them to the client you need to prefix them with `NEXT_PUBLIC`. Validation will fail if you don't to help you detect invalid configuration.
Um sie dem Client zugänglich zu machen, musst du sie mit `NEXT_PUBLIC` präfixen. Die Validierung wird fehlschlagen, wenn du das nicht tust, um dir bei der Erkennung einer ungültigen Konfiguration zu helfen.

### clientEnv Object

Destruct the `process.env` here.
In dieser Datei müssen wir auf die Werte vom `process.env`-Objekt zugreifen.

We need a JavaScript object that we can parse our Zod-schemas with and due to the way Next.js handles environment variables, you can't destruct `process.env` like a regular object, so we need to do it manually.
Wir benötigen ein JavaScript-Objekt, welches wir durch die Zod-Schemata parsen können und aufgrund der Art, wie Next.js Umgebungsvariablen behandelt. Da wir das `process.env`-Objekt nicht wie ein normales Objekt zerlegen ("destruct") können, müssen wir dies manuell machen.
jln13x marked this conversation as resolved.
Show resolved Hide resolved

TypeScript will help you make sure that you have entered the keys in both `clientEnv` as well as `clientSchema`.
TypeScript wird dir helfen, sicherzustellen, dass du die Schlüssel sowohl in `clientEnv` als auch in `clientSchema` eingegeben hast.

```ts
// ❌ This doesn't work, we need to destruct it manually
// ❌ Das funktioniert nicht. Wir müssen es manuell zerlegen.
const schema = z.object({
NEXT_PUBLIC_WS_KEY: z.string(),
});
Expand All @@ -68,46 +69,46 @@ const validated = schema.parse(process.env);

## server.mjs & client.mjs

This is where the validation happens and exports the validated objects. You shouldn't need to modify these files.
Hier findet die Validierung statt und die validierten Objekte werden exportiert. Diese Dateien solltest du nicht bearbeiten müssen.

## Using Environment Variables
## Umgebungsvariablen verwenden

When you want to use your environment variables, you can import them from `env/client.mjs` or `env/server.mjs` depending on where you want to use them:
Wenn du deine Umgebungsvariablen verwenden möchtest, kannst du sie aus `env/client.mjs` oder `env/server.mjs` importieren, je nachdem, wo du sie verwenden möchtest:

```ts:pages/api/hello.ts
import { env } from "../../env/server.mjs";

// `env` is fully typesafe and provides autocompletion
// `env` ist vollständig typisiert und ermöglicht Autovervollständigung
const dbUrl = env.DATABASE_URL;
```

## .env.example

Since the default `.env` file is not committed to version control, we have also included a `.env.example` file, in which you can optionally keep a copy of your `.env` file with any secrets removed. This is not required, but we recommend keeping the example up to date to make it as easy as possible for contributors to get started with their environment.
Da die Standard `.env`-Datei nicht versioniert wird, haben wir ebenfalls eine `.env.example`-Datei beigefügt, in der du optional eine Kopie deiner `.env`-Datei mit entfernten geheimen Werten speichern kannst. Dies ist nicht erforderlich, aber wir empfehlen, das Beispiel auf dem neuesten Stand zu halten, um es für Mitwirkende so einfach wie möglich zu machen, ihre Umgebung zum Laufen zu bekommen.

## Adding Environment Variables
## Umgebungsvariablen hinzufügen

To ensure your build never completes without the environment variables the project needs, you will need to add new environment variables in **two** locations:
Um sicherzustellen, dass dein Build niemals ohne die Umgebungsvariablen abgeschlossen wird, die das Projekt benötigt, musst du neue Umgebungsvariablen an **zwei** Stellen hinzufügen:

📄 `.env`: Enter your environment variable like you would normally do in a `.env` file, i.e. `KEY=VALUE`
📄 `.env`: Schreibe hier deine Umgebungsvariable wie du es normalerweise in einer `.env`-Datei tun würdest, z.B. `KEY=VALUE`

📄 `schema.mjs`: Add the appropriate validation logic for the environment variable by defining a Zod schema, e.g. `KEY: z.string()`
📄 `schema.mjs`: Füge die entsprechende Validierungslogik für die Umgebungsvariable hinzu, indem du ein Zod-Schema definierst, z.B. `KEY: z.string()`

Optionally, you can also keep `.env.example` updated:
Optional kannst du auch `.env.example` aktualisieren:

📄 `.env.example`: Enter your environment variable, but be sure to not include the value if it is secret, i.e. `KEY=VALUE` or `KEY=`
📄 `.env.example`: Füge deine Umgebungsvariable hinzu, aber vergiss nicht, den Wert zu entfernen, wenn er geheim ist, z.B. `KEY=VALUE` oder `KEY=`
jln13x marked this conversation as resolved.
Show resolved Hide resolved

### Example
### Beispiel

_I want to add my Twitter API Token as a server-side environment variable_
_Ich möchte meinen Twitter-API-Token als Server-Umgebungsvariable hinzufügen_

1. Add the environment variable to `.env`:
1. Füge die Umgebungsvariable in die `.env`-Datei ein:

```
TWITTER_API_TOKEN=1234567890
```

2. Add the environment variable to `schema.mjs`:
2. Füge die Umgebungsvariable in `schema.mjs` ein:

```ts
export const serverSchema = z.object({
Expand All @@ -116,9 +117,9 @@ export const serverSchema = z.object({
});
```

_**NOTE:** An empty string is still a string, so `z.string()` will accept an empty string as a valid value. If you want to make sure that the environment variable is not empty, you can use `z.string().min(1)`._
_**Notiz:** Ein leerer String ist immer noch ein String und deshalb wird `z.string()` einen leeren String als gültigen Wert akzeptieren. Wenn du sicherstellen möchtest, dass die Umgebungsvariable nicht leer ist, kannst du `z.string().min(1)` verwenden._

3. optional: Add the environment variable to `.env.example`, but don't include the token
3. optional: Füge die Umgebungsvariable in `.env.example` ein, aber vergiss nicht, den Wert zu entfernen

```
TWITTER_API_TOKEN=
Expand Down