Communitygithub.com

JantonioFC/skillsbank

Modèles d'internationalisation et de localisation. Détection des chaînes codées en dur, gestion des traductions, fichiers de locale, support RTL.

Qu'est-ce que skillsbank ?

Cette compétence fournit un guide structuré et complet sur les meilleures pratiques d'internationalisation (i18n) et de localisation (L10n) pour les développeurs. Elle couvre les concepts clés, les critères de décision pour intégrer i18n dans un projet, et des exemples d'implémentation concrets pour des frameworks populaires comme React (react-i18next), Next.js (next-intl) et Python (gettext). Le guide détaille également l'organisation des fichiers de traduction, les bonnes pratiques (comme l'utilisation de clés et la gestion des pluriels), et les pièges à éviter (comme le texte codé en dur). Enfin, la compétence aborde le support des langues de droite à gauche (RTL), fournit une checklist de vérification avant le déploiement, et inclut un script Python pour détecter les chaînes codées en dur et les traductions manquantes dans un projet.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/JantonioFC/skillsbank/tree/HEAD/plugins/antigravity-awesome-skills-claude/skills/i18n-localization

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

i18n et Localisation

Meilleures pratiques d'internationalisation (i18n) et de localisation (L10n).


1. Concepts Clés

TermeSignification
i18nInternationalisation - rendre l'application traduisible
L10nLocalisation - traductions réelles
LocaleLangue + Région (en-US, tr-TR)
RTLLangues de droite à gauche (Arabe, Hébreu)

2. Quand Utiliser i18n

Type de Projeti18n Nécessaire ?
Application web publique✅ Oui
Produit SaaS✅ Oui
Outil interne⚠️ Peut-être
Application mono-région⚠️ Considérer le futur
Projet personnel❌ Optionnel

3. Implémentation

React (react-i18next)

import { useTranslation } from 'react-i18next';

function Welcome() {
  const { t } = useTranslation();
  return <h1>{t('welcome.title')}</h1>;
}

Next.js (next-intl)

import { useTranslations } from 'next-intl';

export default function Page() {
  const t = useTranslations('Home');
  return <h1>{t('title')}</h1>;
}

Python (gettext)

from gettext import gettext as _

print(_("Bienvenue dans notre application"))

4. Structure des Fichiers

locales/
├── en/
│   ├── common.json
│   ├── auth.json
│   └── errors.json
├── tr/
│   ├── common.json
│   ├── auth.json
│   └── errors.json
└── ar/          # RTL
    └── ...

5. Bonnes Pratiques

À FAIRE ✅

  • Utiliser des clés de traduction, pas du texte brut
  • Espace de nommage des traductions par fonctionnalité
  • Gérer la pluralisation
  • Adapter les formats de date/par nombre selon la locale
  • Planifier le support RTL dès le départ
  • Utiliser le format de message ICU pour les chaînes complexes

À ÉVITER ❌

  • Écrire du texte codé en dur dans les composants
  • Concaténer des chaînes traduites
  • Présumer de la longueur du texte (l'allemand est 30% plus long)
  • Oublier la mise en page RTL
  • Mélanger les langues dans un même fichier

6. Problèmes Courants

ProblèmeSolution
Traduction manquanteRepli sur la langue par défaut
Texte codé en durUtiliser un script de linting/vérification
Format de dateUtiliser Intl.DateTimeFormat
Format de nombreUtiliser Intl.NumberFormat
PluralisationUtiliser le format de message ICU

7. Support RTL

/* Propriétés logiques CSS */
.container {
  margin-inline-start: 1rem;  /* Pas margin-left */
  padding-inline-end: 1rem;   /* Pas padding-right */
}

[dir="rtl"] .icon {
  transform: scaleX(-1);
}

8. Checklist

Avant de livrer :

  • Toutes les chaînes visibles par l'utilisateur utilisent des clés de traduction
  • Les fichiers de locale existent pour toutes les langues supportées
  • Le formatage des dates/nombres utilise l'API Intl
  • La mise en page RTL est testée (si applicable)
  • Une langue de repli est configurée
  • Aucun texte codé en dur dans les composants

Script

ScriptObjectifCommande
scripts/i18n_checker.pyDétecter les chaînes codées en dur et les traductions manquantespython scripts/i18n_checker.py <chemin_du_projet>

Quand Utiliser

Cette compétence est applicable pour exécuter le flux de travail ou les actions décrits dans l'aperçu.

Limites

  • Utilisez cette compétence uniquement lorsque la tâche correspond clairement au périmètre décrit ci-dessus.
  • Ne considérez pas la sortie comme un substitut à une validation, un test ou une revue d'expert spécifique à l'environnement.
  • Arrêtez-vous et demandez des clarifications si les entrées requises, les permissions, les limites de sécurité ou les critères de succès sont manquants.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

JantonioFC/skillsbank

AI-powered image editing with style transfer and object removal

JantonioFC/skillsbank

Analise e auditoria de editais de leilao judicial e extrajudicial. Riscos ocultos, clausulas perigosas, debitos, ocupante e classificacao da oportunidade.

JantonioFC/skillsbank

Embed Photopea in web apps using photopea.js. Covers embedding, file I/O, scripting, exporting, layers, text, filters, and the full Photoshop-compatible API.

JantonioFC/skillsbank

Best practices for Remotion - Video creation in React

JantonioFC/skillsbank

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

JantonioFC/skillsbank

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

JantonioFC/skillsbank

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

JantonioFC/skillsbank

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

JantonioFC/skillsbank

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

JantonioFC/skillsbank

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

JantonioFC/skillsbank

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

JantonioFC/skillsbank

Tool lifecycle UI components for React/Next.js from ui.inference.sh. Display tool calls: pending, progress, approval required, results. Capabilities: tool status, progress indicators, approval flows, results display. Use for: showing agent tool calls, human-in-the-loop approvals, tool output. Triggers: tool ui, tool calls, tool status, tool approval, tool results, agent tools, mcp tools ui, function calling ui, tool lifecycle, tool pending

JantonioFC/skillsbank

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

JantonioFC/skillsbank

When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions 'PPC,' 'paid media,' 'ROAS,' 'CPA,' 'ad campaign,' 'retargeting,' 'audience targeting,' 'Google Ads,' 'Facebook ads,'...

JantonioFC/skillsbank

Create AI avatar and talking head videos with OmniHuman, Fabric, PixVerse via inference.sh CLI. Models: OmniHuman 1.5, OmniHuman 1.0, Fabric 1.0, PixVerse Lipsync. Capabilities: audio-driven avatars, lipsync videos, talking head generation, virtual presenters. Use for: AI presenters, expla...

JantonioFC/skillsbank

Create AI marketing videos for ads, promos, product launches, and brand content. Models: Veo, Seedance, Wan, FLUX for visuals, Kokoro for voiceover. Types: product demos, testimonials, explainers, social ads, brand videos. Use for: Facebook ads, YouTube ads, product launches, brand awarene...

JantonioFC/skillsbank

Generate AI videos with Google Veo, Seedance, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 1.5 Pro, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, lipsync, avatar animation, video upscaling, fole...

JantonioFC/skillsbank

Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown.

JantonioFC/skillsbank

Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

JantonioFC/skillsbank

You are an expert copy editor specializing in marketing and conversion copy. Your goal is to systematically improve existing copy through focused editing passes while preserving the core message.

Skills associés