Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问clear审计通过

i18n-date-patterns国际化日期模式

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

2,770

周安装

119

GitHub Stars

161

下载量

971
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:i18n-date-patterns(国际化日期模式)
来源仓库:https://github.com/yonatangross/orchestkit
仓库路径:skills/i18n-date-patterns
安装命令:
npx skills add https://github.com/yonatangross/orchestkit --skill i18n-date-patterns
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill i18n-date-patterns

简介

i18n-date-patterns 用于辅助前端页面、组件和样式开发,适合生成或审查 React、Next.js、Vue 等相关代码。

  • 适用于国际化项目中日期格式、时区处理和本地化组件的实现与维护场景。
  • Agent 可整理组件结构、生成样式逻辑或定位布局和性能问题,需结合项目设计系统使用。
  • 涉及页面改动时应配合本地预览和构建检查,避免只生成孤立代码片段。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

i18n and Localization Patterns

Overview

This skill provides comprehensive guidance for implementing internationalization in React applications. It ensures ALL user-facing strings, date displays, currency, lists, and time calculations are locale-aware.

When to use this skill:

  • Adding ANY user-facing text to components
  • Formatting dates, times, currency, lists, or ordinals
  • Implementing complex pluralization
  • Embedding React components in translated text
  • Supporting RTL languages (Hebrew, Arabic)

Bundled Resources (load with Read("${CLAUDE_SKILL_DIR}/<path>")):

  • references/formatting-utilities.md - useFormatting hook API reference
  • references/icu-messageformat.md - ICU plural/select syntax
  • references/trans-component.md - Trans component for rich text
  • checklists/i18n-checklist.md - Implementation and review checklist
  • examples/component-i18n-example.md - Complete component example

Canonical Reference: See docs/i18n-standards.md for the full i18n standards document.


Core Patterns

1. useTranslation Hook (All UI Strings)

Every visible string MUST use the translation function:

import { useTranslation } from 'react-i18next';

function MyComponent() {
  const { t } = useTranslation(['patients', 'common']);

  return (
    <div>
      <h1>{t('patients:title')}</h1>
      <button>{t('common:actions.save')}</button>
    </div>
  );
}

2. useFormatting Hook (Locale-Aware Data)

All locale-sensitive formatting MUST use the centralized hook:

import { useFormatting } from '@/hooks';

function PriceDisplay({ amount, items }) {
  const { formatILS, formatList, formatOrdinal } = useFormatting();

  return (
    <div>
      <p>Price: {formatILS(amount)}</p>        {/* ₪1,500.00 */}
      <p>Items: {formatList(items)}</p>        {/* "a, b, and c" */}
      <p>Position: {formatOrdinal(3)}</p>      {/* "3rd" */}
    </div>
  );
}

Load Read("${CLAUDE_SKILL_DIR}/references/formatting-utilities.md") for the complete API.

3. Date Formatting

All dates MUST use the centralized @/lib/dates library:

import { formatDate, formatDateShort, calculateWaitTime } from '@/lib/dates';

const date = formatDate(appointment.date);    // "Jan 6, 2026"
const waitTime = calculateWaitTime('09:30');  // "15 min"

4. ICU MessageFormat (Complex Plurals)

Use ICU syntax in translation files for pluralization:

{
  "patients": "{count, plural, =0 {No patients} one {# patient} other {# patients}}"
}
t('patients', { count: 5 })  // → "5 patients"

Load Read("${CLAUDE_SKILL_DIR}/references/icu-messageformat.md") for full syntax.

5. Trans Component (Rich Text)

For embedded React components in translated text:

import { Trans } from 'react-i18next';

<Trans
  i18nKey="richText.welcome"
  values={{ name: userName }}
  components={{ strong: <strong /> }}
/>

Load Read("${CLAUDE_SKILL_DIR}/references/trans-component.md") for patterns.


Translation File Structure

frontend/src/i18n/locales/
├── en/
│   ├── common.json      # Shared: actions, status, time
│   ├── patients.json    # Patient-related strings
│   ├── dashboard.json   # Dashboard strings
│   ├── owner.json       # Owner portal strings
│   └── invoices.json    # Invoice strings
└── he/
    └── (same structure)

Anti-Patterns (FORBIDDEN)

// ❌ NEVER hardcode strings
<h1>מטופלים</h1>                    // Use t('patients:title')
<button>Save</button>               // Use t('common:actions.save')

// ❌ NEVER use .join() for lists
items.join(', ')                    // Use formatList(items)

// ❌ NEVER hardcode currency
"₪" + price                         // Use formatILS(price)

// ❌ NEVER use new Date() for formatting
new Date().toLocaleDateString()     // Use formatDate() from @/lib/dates

// ❌ NEVER use inline plural logic
count === 1 ? 'item' : 'items'      // Use ICU MessageFormat

// ❌ NEVER leave console.log in production
console.log('debug')                // Remove before commit

// ❌ NEVER use dangerouslySetInnerHTML for i18n
dangerouslySetInnerHTML             // Use <Trans> component

Quick Reference

NeedSolution
UI textt('namespace:key') from useTranslation
CurrencyformatILS(amount) from useFormatting
ListsformatList(items) from useFormatting
OrdinalsformatOrdinal(n) from useFormatting
DatesformatDate(date) from @/lib/dates
PluralsICU MessageFormat in translation files
Rich text<Trans> component
RTL checkisRTL from useFormatting

Checklist

Load Read("${CLAUDE_SKILL_DIR}/checklists/i18n-checklist.md") for complete implementation and review checklists.


Integration with Agents

Frontend UI Developer

  • Uses all i18n patterns for components
  • References this skill for formatting
  • Ensures no hardcoded strings

Code Quality Reviewer

  • Checks for anti-patterns (.join(), console.log, etc.)
  • Validates translation key coverage
  • Ensures RTL compatibility

Skill Version: 1.2.0 Last Updated: 2026-01-06 Maintained by: Yonatan Gross

Related Skills

  • ork:testing-e2e - E2E testing patterns including accessibility testing for i18n
  • type-safety-validation - Zod schemas for validating translation key structures and locale configs
  • ork:react-server-components-framework - Server-side locale detection and RSC i18n patterns
  • ork:accessibility - RTL-aware focus management for bidirectional UI navigation

Key Decisions

DecisionChoiceRationale
Translation Libraryreact-i18nextReact-native hooks, namespace support, ICU format
Date LibrarydayjsLightweight, locale plugins, immutable API
Message FormatICU MessageFormatIndustry standard, complex plural/select support
Locale StoragePer-namespace JSONCode-splitting, lazy loading per feature
RTL DetectionCSS logical propertiesNative browser support, no JS overhead

Capability Details

translation-hooks

Keywords: useTranslation, t(), i18n hook, translation hook Solves:

  • Translate UI strings with useTranslation
  • Implement namespaced translations
  • Handle missing translation keys

formatting-hooks

Keywords: useFormatting, formatCurrency, formatList, formatOrdinal Solves:

  • Format currency values with locale
  • Format lists with proper separators
  • Handle ordinal numbers across locales

icu-messageformat

Keywords: ICU, MessageFormat, plural, select, pluralization Solves:

  • Implement pluralization rules
  • Handle gender-specific translations
  • Build complex message patterns

date-time-formatting

Keywords: date format, time format, dayjs, locale date, calendar Solves:

  • Format dates with dayjs and locale
  • Handle timezone-aware formatting
  • Build calendar components with i18n

rtl-support

Keywords: RTL, right-to-left, hebrew, arabic, direction Solves:

  • Support RTL languages like Hebrew
  • Handle bidirectional text
  • Configure RTL-aware layouts

trans-component

Keywords: Trans, rich text, embedded JSX, interpolation Solves:

  • Embed React components in translations
  • Handle rich text formatting
  • Implement safe HTML in translations

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

windsurf

31.15%
按下载量换算302

trae

23.49%
按下载量换算228

Claude Code

18.15%
按下载量换算176

Antigravity

13.13%
按下载量换算127

Gemini CLI

7.55%
按下载量换算73

OpenCode

3.33%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills