Skip to content

Commit 6c2d8e0

Browse files
authored
Add prompt for adding a new language to Next.js using next-intl (#34)
* Add prompt for adding a new language to Next.js using next-intl * Update README and prompt for Next.js i18n integration with next-intl
1 parent cee964c commit 6c2d8e0

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi
5858
- [Multi Stage Dockerfile](prompts/multi-stage-dockerfile.prompt.md) - Create optimized multi-stage Dockerfiles for any language or framework
5959
- [My Issues](prompts/my-issues.prompt.md) - List my issues in the current repository
6060
- [My Pull Requests](prompts/my-pull-requests.prompt.md) - List my pull requests in the current repository
61+
- [Next Intl Add Language](prompts/next-intl-add-language.prompt.md) - Add new language to a Next.js + next-intl application
6162

6263
> 💡 **Usage**: Use `/prompt-name` in VS Code chat, run `Chat: Run Prompt` command, or hit the run button while you have a prompt open.
6364
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
mode: 'agent'
3+
tools: ['changes','codebase', 'editFiles', 'findTestFiles', 'search', 'writeTest']
4+
description: 'Add new language to a Next.js + next-intl application'
5+
---
6+
7+
This is a guide to add a new language to a Next.js project using next-intl for internationalization,
8+
9+
- For i18n, the application uses next-intl.
10+
- All translations are in the directory `./messages`.
11+
- The UI component is `src/components/language-toggle.tsx`.
12+
- Routing and middleware configuration are handled in:
13+
- `src/i18n/routing.ts`
14+
- `src/middleware.ts`
15+
16+
When adding a new language:
17+
18+
- Translate all the content of `en.json` to the new language. The goal is to have all the JSON entries in the new language for a complete translation.
19+
- Add the path in `routing.ts` and `middleware.ts`.
20+
- Add the language to `language-toggle.tsx`.

0 commit comments

Comments
 (0)