Skip to content

Commit 2d511e8

Browse files
committed
chore: update translation docs
1 parent 02cea3c commit 2d511e8

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

apps/client/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ module.exports = {
44
pages: {
55
"*": ["peppermint"],
66
},
7-
localeDetection: false,
7+
localeDetection: true,
88
};

apps/docs/pages/translation.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ Before you begin, ensure you have the following:
1717
Navigate to the directory where language files are stored. This is typically a folder named `locales` or `i18n`.
1818

1919
```bash
20-
cd path/to/your/project/locales
20+
cd apps/client/locales
2121
```
2222

2323
Create a new file for the language you want to add. For example, to add French, create a file named `fr.json`.
2424

2525
```bash
26-
touch fr.json
26+
touch /fr/peppermint.json
2727
```
2828

2929
2. **Add Translations**
3030

3131
Open the newly created language file and add the necessary translations. Use the existing language files as a reference for the structure.
3232

33+
Copy the contents of the English file and translate it to the new language.
34+
3335
```json
3436
{
3537
"welcome": "Bienvenue",
@@ -43,22 +45,27 @@ Before you begin, ensure you have the following:
4345
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.
4446

4547
```javascript
46-
// config/i18n.js
47-
export const supportedLanguages = ['en', 'fr', 'es'];
48+
// i18n.js
49+
export const supportedLanguages = ["en", "fr", "es"];
4850
```
4951

5052
4. **Test the New Language**
5153

5254
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.
5355

56+
This requires you to have the application running.
57+
5458
```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
5663
```
5764

5865
Access the application and switch to French:
5966

6067
```
61-
http://localhost:3000?lang=fr
68+
http://localhost:3000/fr/
6269
```
6370

6471
5. **Update Documentation**
@@ -91,4 +98,3 @@ If you encounter any issues, consider the following:
9198
---
9299

93100
Feel free to reach out to the project maintainers if you have any questions or need further assistance. Happy localizing!
94-

0 commit comments

Comments
 (0)