Internationalization (i18n)

Internationalization (i18n)

Implements internationalization and localization: translation catalogs, pluralization, date and number formatting, RTL support and i18n libraries.

Skill files12 files

references/

templates/

SKILL.md116 lines
1
---
2
name: internationalization-i18n
3
description: >
4
Implement internationalization (i18n) and localization including message
5
extraction, translation catalogs, pluralization rules, date/time/number
6
formatting, RTL language support, and i18n libraries like i18next and gettext.
7
Use for multi-language, translation, or localization needs.
8
---
9
10
# Internationalization (i18n) & Localization
11
12
## Table of Contents
13
14
- [Overview](#overview)
15
- [When to Use](#when-to-use)
16
- [Quick Start](#quick-start)
17
- [Reference Guides](#reference-guides)
18
- [Best Practices](#best-practices)
19
20
## Overview
21
22
Comprehensive guide to implementing internationalization and localization in applications. Covers message translation, pluralization, date/time/number formatting, RTL languages, and integration with popular i18n libraries.
23
24
## When to Use
25
26
- Building multi-language applications
27
- Supporting international users
28
- Implementing language switching
29
- Formatting dates, times, and numbers for different locales
30
- Supporting RTL (right-to-left) languages
31
- Extracting and managing translation strings
32
- Implementing pluralization rules
33
- Setting up translation workflows
34
35
## Quick Start
36
37
Minimal working example:
38
39
```typescript
40
// i18n.ts
41
import i18next from "i18next";
42
import Backend from "i18next-http-backend";
43
import LanguageDetector from "i18next-browser-languagedetector";
44
45
await i18next
46
.use(Backend)
47
.use(LanguageDetector)
48
.init({
49
fallbackLng: "en",
50
debug: process.env.NODE_ENV === "development",
51
52
interpolation: {
53
escapeValue: false, // React already escapes
54
},
55
56
backend: {
57
loadPath: "/locales/{{lng}}/{{ns}}.json",
58
},
59
60
detection: {
61
order: ["querystring", "cookie", "localStorage", "navigator"],
62
caches: ["localStorage", "cookie"],
63
},
64
});
65
// ... (see reference guides for full implementation)
66
```
67
68
## Reference Guides
69
70
Detailed implementations in the `references/` directory:
71
72
| Guide | Contents |
73
|---|---|
74
| [i18next (JavaScript/TypeScript)](references/i18next-javascripttypescript.md) | i18next (JavaScript/TypeScript) |
75
| [React-Intl (Format.js)](references/react-intl-formatjs.md) | React-Intl (Format.js) |
76
| [Python i18n (gettext)](references/python-i18n-gettext.md) | Python i18n (gettext) |
77
| [Date and Time Formatting](references/date-and-time-formatting.md) | Date and Time Formatting |
78
| [Number and Currency Formatting](references/number-and-currency-formatting.md) | Number and Currency Formatting |
79
| [Pluralization Rules](references/pluralization-rules.md) | Pluralization Rules |
80
| [RTL (Right-to-Left) Language Support](references/rtl-right-to-left-language-support.md) | RTL (Right-to-Left) Language Support |
81
| [Translation Management](references/translation-management.md) | Translation Management |
82
| [Locale Detection](references/locale-detection.md) | Locale Detection |
83
| [Server-Side i18n](references/server-side-i18n.md) | Server-Side i18n |
84
85
## Best Practices
86
87
### ✅ DO
88
89
- Extract all user-facing strings to translation files
90
- Use ICU message format for complex messages
91
- Support pluralization correctly for each language
92
- Use locale-aware date/time/number formatting
93
- Implement RTL support for Arabic, Hebrew, etc.
94
- Provide fallback language (usually English)
95
- Use namespaces to organize translations
96
- Test with pseudo-localization (ääçćëńţś)
97
- Store locale preference (cookie, localStorage)
98
- Use professional translators for production
99
- Implement translation management workflow
100
- Support dynamic locale switching
101
- Use translation memory tools
102
103
### ❌ DON'T
104
105
- Hardcode user-facing strings in code
106
- Concatenate translated strings
107
- Assume English grammar rules apply to all languages
108
- Use generic plural forms (one/many) for all languages
109
- Forget about text expansion (German is ~30% longer)
110
- Store dates/times in locale-specific formats
111
- Use flags to represent languages (flag ≠ language)
112
- Translate technical terms without context
113
- Mix translation keys with UI strings
114
- Forget to translate alt text, titles, placeholders
115
- Assume left-to-right layout
116

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,252 prompts

More by @OpenSourceBuffGuy

See all
Woman in cat ear beanie and duffle coat prompt image

Woman in cat ear beanie and duffle coat

Edits a photo so the person wears a locked outfit: cat-ear beanie, duffle coat, bloomers, leg warmers and platform boots, each with exact colours and hardware.

image-prompt, virtual-try-on, photo-editing, reference-image, fashion, fashion-shoot, footwear, woman, guardrails, gpt-image, chatgpt, muted-colors, cozy, long-form, advanced, structured-output, template

User Research Analyst prompt image

User Research Analyst

Acts as a senior UX researcher that designs usability studies and interview guides, analyses research notes and turns them into evidence-backed UX recommendations.

system-prompt, act-as, user-research, ui-ux, product-management, research-methods, data-analysis, question-generation, for-product-managers, for-designers, for-researchers, structured-output, xml-tags, expert-advice, report, survey, critique, guided-interview, advanced, long-form, guardrails, customer-persona

Four Portraits Peeking Through Yellow Paper prompt image

Four Portraits Peeking Through Yellow Paper

Creates a 2x2 grid of four young men peeking through ripped holes in bright yellow paper, in a 1990s indie-band studio editorial style.

image-prompt, nano-banana, multi-panel, collage, photorealistic, editorial, portrait, man, group-photo, studio-lighting, soft-lighting, vibrant-colors, split-screen, cinematic, indie, fashion, symmetry, bokeh, square-format

Reviews

Loading reviews…

Discussion

Loading comments…