You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/pages/translation.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,21 @@ Before you begin, ensure you have the following:
17
17
Navigate to the directory where language files are stored. This is typically a folder named `locales` or `i18n`.
18
18
19
19
```bash
20
-
cdpath/to/your/project/locales
20
+
cdapps/client/locales
21
21
```
22
22
23
23
Create a new file for the language you want to add. For example, to add French, create a file named `fr.json`.
24
24
25
25
```bash
26
-
touch fr.json
26
+
touch /fr/peppermint.json
27
27
```
28
28
29
29
2.**Add Translations**
30
30
31
31
Open the newly created language file and add the necessary translations. Use the existing language files as a reference for the structure.
32
32
33
+
Copy the contents of the English file and translate it to the new language.
34
+
33
35
```json
34
36
{
35
37
"welcome": "Bienvenue",
@@ -43,22 +45,27 @@ Before you begin, ensure you have the following:
43
45
If your project has a configuration file for supported languages (e.g., `config.js` or `i18n.js`), add the new language to the list of supported languages.
Start your application and switch to the new language to ensure that translations are displayed correctly. This might involve changing a language setting in your application or using a URL parameter.
53
55
56
+
This requires you to have the application running.
57
+
54
58
```bash
55
-
npm start
59
+
yarn install --legacy-peer-deps
60
+
cd apps/api && npm run db:migrate
61
+
cd ../../
62
+
yarn dev --filter=client --filter=api
56
63
```
57
64
58
65
Access the application and switch to French:
59
66
60
67
```
61
-
http://localhost:3000?lang=fr
68
+
http://localhost:3000/fr/
62
69
```
63
70
64
71
5.**Update Documentation**
@@ -91,4 +98,3 @@ If you encounter any issues, consider the following:
91
98
---
92
99
93
100
Feel free to reach out to the project maintainers if you have any questions or need further assistance. Happy localizing!
0 commit comments