Claude Code Plugins

Community-maintained marketplace

Feedback

internationalization

@TakumiOkayasu/dotfile-work
0
0

i18nやタイムゾーン処理を実装する際に使用。

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name internationalization
description i18nやタイムゾーン処理を実装する際に使用。

Internationalization

鉄則

最初から国際化を意識。後付けは困難。

テキスト外部化

// ❌
const msg = 'ユーザーが見つかりません';

// ✅
const msg = t('errors.userNotFound');
const greeting = t('greeting', { name });

翻訳ファイル

// locales/ja/common.json
{
  "greeting": "こんにちは、{{name}}さん",
  "errors": { "userNotFound": "ユーザーが見つかりません" }
}

複数形

// 英語
{ "items": "{{count}} item", "items_plural": "{{count}} items" }

// 日本語(複数形なし)
{ "items": "{{count}}個" }

日付・数値

// Intl API
new Intl.DateTimeFormat('ja-JP').format(date);
// → "2024/1/15"

new Intl.NumberFormat('ja-JP', {
  style: 'currency', currency: 'JPY'
}).format(1234);
// → "¥1,234"

タイムゾーン

サーバー: UTC保存
API: ISO 8601 ("2024-01-15T10:30:00Z")
クライアント: ユーザーのTZで表示
const userTz = Intl.DateTimeFormat().resolvedOptions().timeZone;

RTL言語

/* 論理プロパティ */
margin-inline-start: 1rem;  /* 左/右ではなく開始側 */
<html dir="rtl" lang="ar">