Skip to content

Commit 3098f35

Browse files
docs: explains i18n language changing (#10964)
Elaborate how one is supposed to change the admin panel's language because it is not initially clear or trivial to someone new and going through the docs from the start. --------- Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
1 parent d7dee22 commit 3098f35

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/configuration/i18n.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,19 @@ export const Articles: CollectionConfig = {
172172
}
173173
```
174174

175-
## Node
175+
## Changing Languages
176+
177+
Users can change their preferred language in their account settings or by otherwise manipulating their [User Preferences](../admin/preferences).
178+
179+
## Node.js#node
176180

177181
Payload's backend sets the language on incoming requests before they are handled. This allows backend validation to return error messages in the user's own language or system generated emails to be sent using the correct translation. You can make HTTP requests with the `accept-language` header and Payload will use that language.
178182

179183
Anywhere in your Payload app that you have access to the `req` object, you can access Payload's extensive internationalization features assigned to `req.i18n`. To access text translations you can use `req.t('namespace:key')`.
180184

181185
## TypeScript
182186

183-
In order to use custom translations in your project, you need to provide the types for the translations.
187+
In order to use [Custom Translations](#custom-translations) in your project, you need to provide the types for the translations.
184188

185189
Here we create a shareable translations object. We will import this in both our custom components and in our Payload config.
186190

@@ -259,4 +263,3 @@ const field: Field = {
259263
) => t('fields:addLabel'),
260264
}
261265
```
262-

0 commit comments

Comments
 (0)