internationalization-i18n · mindrally — скилл для Claude Code: i18n в веб
Скилл задаёт агенту правила интернационализации: переводы, форматирование дат и чисел, RTL-раскладка. Пригодится, когда приложение выходит на новые языки.
npx skills add Mindrally/skills --skill internationalization-i18n -a claude-codeЧто делает internationalization-i18n
Скилл превращает агента в инструкцию по i18n для веб- и мобильных приложений. Он требует, чтобы весь текст, который видит пользователь, шёл через переводы, а не лежал строкой в компоненте. Для React и Next.js агент берёт i18next и react-i18next, организует переводы по неймспейсам, добавляет интерполяцию и плюрализацию. Для Nuxt.js — модуль @nuxtjs/i18n и локализованные маршруты. В React Native и Expo ставка на expo-localization и определение локали устройства.
Внутри — набор правил, а не готовый код. Агент следует им, когда пишет или правит ваш проект: раскладывает переводы по файлам вида locales/en/common.json, советует иерархические ключи вроде auth.login.button, форматирует даты через Intl.DateTimeFormat, числа и валюту через Intl.NumberFormat, сортировку через Intl.Collator. Для RTL предлагает CSS-логические свойства (margin-inline-start, padding-inline-end) и зеркалирование интерфейса. Состояние языка хранится в Zustand или React Context с записью в localStorage и AsyncStorage.
Ограничение простое: скилл описывает подход, но не подключает библиотеки за вас. Пакеты вроде i18next, @nuxtjs/i18n или expo-localization придётся поставить в проект самому, иначе агенту не на что опереться. Дизайн под расширение текста скилл закладывает сразу: в некоторых языках строка занимает на 30-50% больше места, поэтому жёсткие контейнеры по ширине текста — повод проверить вёрстку до релиза.
Какие задачи решает
- вынести все пользовательские строки в файлы переводов
- настроить i18next в React или Next.js с неймспейсами
- добавить плюрализацию и интерполяцию в переводах
- отформатировать даты, числа и валюту по локали пользователя
- сделать RTL-раскладку через CSS-логические свойства
Примеры запросов агенту
- Настрой i18n в этом Next.js проекте на i18next, разложи переводы по неймспейсам
- Добавь плюрализацию для счётчика товаров и форматирование цены по локали
- Переведи этот экран React Native на RTL и проверь, что вёрстка не ломается
Как установить internationalization-i18n
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill internationalization-i18n -a claude-code2Вручную: положить файлы
~/.claude/skills/internationalization-i18n/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/internationalization-i18n/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill internationalization-i18n -a codex2Вручную: положить файлы
.agents/skills/internationalization-i18n/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill internationalization-i18n -a cursor2Вручную: положить файлы
.cursor/skills/internationalization-i18n/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills internationalization-i18n2Вручную: положить файлы
.github/skills/internationalization-i18n/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill internationalization-i18n -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path internationalization-i18nВручную: положить файлы
.devin/skills/internationalization-i18n/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill internationalization-i18n -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора168
Другие версии internationalization-i18n
Похожие
Рядом в теме «Фронтенд и UI»
Всё по теме «Фронтенд и UI» →Вопросы о internationalization-i18n
Как установить internationalization-i18n в Claude?
Выполните npx skills add Mindrally/skills --skill internationalization-i18n -a claude-code. Скилл появится в ~/.claude/skills/internationalization-i18n/SKILL.md.
Что делает internationalization-i18n?
Задаёт агенту правила интернационализации: переводы через i18next или @nuxtjs/i18n, форматирование дат и чисел через Intl, поддержка RTL и хранение выбранного языка.
Нужно ли что-то ставить в проект заранее?
Да. Скилл описывает подход, а библиотеки для переводов и определения локали подключаются в самом проекте.
Исходный текст
SKILL.md · Apache-2.0
---
name: internationalization-i18n
description: Implement internationalization (i18n) best practices for web and mobile applications to support multiple languages and locales.
metadata:
maintainer: Mindrally
source: https://github.com/Mindrally/skills
---
# Internationalization (i18n)
You are an expert in internationalization for web and mobile applications. Apply these guidelines to ensure applications can be easily adapted for different languages, regions, and cultures.
## Core Principles
- Write concise, technical TypeScript code with accurate examples
- Use functional and declarative programming patterns; avoid classes
- Ensure all user-facing text is internationalized and supports localization
- Use descriptive variable names with auxiliary verbs (isLoading, hasError)
- Design for text expansion (some languages require 30-50% more space)
## Web Application i18n
### React/Next.js Applications
- Use i18next and react-i18next for web applications
- Implement namespace-based translation organization
- Use interpolation for dynamic values in translations
- Leverage pluralization features for count-based text
- Implement context-based translations where needed
### Implementation Pattern
```typescript
// Use translation hooks
const { t } = useTranslation('common');
// Basic translation
<h1>{t('welcome.title')}</h1>
// With interpolation
<p>{t('greeting', { name: userName })}</p>
// With pluralization
<span>{t('items', { count: itemCount })}</span>
```
### Nuxt.js Applications
- Use @nuxtjs/i18n module for Vue applications
- Implement SEO best practices with localized routes
- Use `useI18n` composable for translations
- Leverage lazy loading for translation files
## React Native/Expo Applications
### Mobile i18n Setup
- Use expo-localization for React Native apps
- Use react-native-i18n or i18n-js for translations
- Detect device locale automatically
- Support fallback languages
### Mobile-Specific Considerations
- Support RTL (right-to-left) layouts
- Ensure proper text scaling for accessibility
- Handle device locale changes dynamically
- Test on devices with different system languages
## Translation File Organization
### File Structure
```
locales/
en/
common.json
auth.json
errors.json
es/
common.json
auth.json
errors.json
fr/
common.json
auth.json
errors.json
```
### Translation Keys Best Practices
- Use descriptive, hierarchical keys (e.g., `auth.login.button`, `errors.network.timeout`)
- Avoid embedding HTML in translations when possible
- Keep translations context-aware and meaningful
- Document translation context for translators
## Locale-Aware Formatting
### Date and Time
- Use Intl.DateTimeFormat for date formatting
- Respect user's locale preferences
- Store dates in UTC, display in local timezone
- Support multiple date format preferences
### Numbers and Currency
- Use Intl.NumberFormat for number formatting
- Display currency in user's preferred format
- Handle decimal and thousand separators by locale
- Support right-to-left number display where needed
### Sorting and Comparison
- Use Intl.Collator for locale-aware string comparison
- Implement locale-specific sorting rules
- Handle diacritics and special characters correctly
## RTL (Right-to-Left) Support
### Layout Considerations
- Use CSS logical properties (margin-inline-start, padding-inline-end)
- Implement bidirectional text support
- Mirror UI layouts for RTL languages
- Test thoroughly with RTL languages (Arabic, Hebrew, etc.)
### Implementation
```css
/* Use logical properties */
.element {
margin-inline-start: 1rem;
padding-inline-end: 0.5rem;
}
```
## Best Practices
### Development Guidelines
- Never hardcode user-facing strings
- Extract all text to translation files
- Use ICU message format for complex translations
- Implement fallback mechanisms for missing translations
- Support language switching without page reload
### Content Considerations
- Avoid text in images; use CSS/SVG text when possible
- Design flexible layouts that accommodate text expansion
- Use icons with text labels, not icons alone
- Consider cultural differences in imagery and color
### Testing Requirements
- Test with pseudolocalization during development
- Verify text doesn't overflow containers
- Test with actual translations before release
- Verify RTL layout with native speakers
- Test currency and date formats across locales
## State Management for i18n
### Storing User Preferences
- Use Zustand or React Context for language state
- Persist language preference (localStorage, AsyncStorage)
- Sync language preference with user account
- Handle server-side rendering with correct locale
### Data Fetching
- Use TanStack React Query for caching translated content
- Invalidate queries on language change when needed
- Fetch locale-specific content from APIs
- Handle translation loading states gracefully
## Error Handling
- Provide translated error messages
- Implement fallback to default language for missing translations
- Log missing translation keys in development
- Handle RTL/LTR text direction in error displays
- Use Zod for runtime validation with localized error messages
© Mindrally · Apache-2.0 · Mindrally/skills