본문으로 건너뛰기
cccskills
무료GitHub에 공개

i18n

Guides internationalization (i18n) implementation using i18next with TypeScript. Triggered when handling localization, translation files, or multilingual support.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

i18n Internationalization Guide

This skill provides mandatory specifications for implementing internationalization using i18next in this project.

1. Architecture Overview

The project adopts a modular i18n structure:

  • i18next: Core internationalization library.
  • TypeScript: Provides complete type safety protection for translation keys.
  • Modular Structure: Translation copy is organized by functionality/module.
  • Dual-end Support: Simultaneously supports app (renderer process) and desktop (main process).

2. Translation File Structure

2.1 Basic Translation Module

// packages/app/locales/en/global.ts
export default {
	notice: 'Notice',
	edit: 'Edit',
	add: 'Add',
	save: 'Save',
	remove: 'Remove',
	remove_confirm:
		'Confirm removal? Deleting this item will also delete the corresponding local file. Please proceed with caution!'
}

2.2 Namespace Module

// packages/app/locales/en/app.ts
export default {
	module: {
		chat: 'Chat',
		research: 'Research',
		agent: 'Agent'
	},
	workspace: {
		title: 'Workspace',
		name_placeholder: 'A unique name'
	}
}

2.3 Regional Language Entry Point

// packages/app/locales/en/index.ts
import ai from './ai'
import app from './app'
import global from './global'

export default {
	translation: {
		...global,
		app,
		ai
	}
} as const // ✅ Must use as const to ensure TypeScript type inference

3. Steps for Adding New Translations

3.1 Adding New Module Translation

// Step 2: Add to entry index
// packages/app/locales/en/index.ts
import newFeature from './newFeature'

// Step 1: Create new translation file (English and Chinese must be created simultaneously)
// packages/app/locales/en/newFeature.ts
export default {
	title: 'New Feature',
	description: 'This is a new feature description'
}

// packages/app/locales/zh-cn/newFeature.ts
export default {
	title: '新功能',
	description: '这是新功能描述'
}

export default {
	translation: {
		// ... others
		newFeature // Register new module
	}
} as const

4. Constraints and Best Practices

4.1 Naming Conventions

  • Keys: Translation keys must use snake_case.
  • Structure: Organize key names hierarchically by functionality or component.
  • Consistency: Must maintain completely consistent key name structure across all language files.

4.2 Code Style Requirements

  • No Comments: Do not add any comments to translation files.
  • Default Export: Always use export default to export translation objects.
  • Type Safety: In regional language index exports, always use as const.
  • Flat Structure: Keep translation objects as flat as possible (nesting should not exceed 3 levels).

4.3 Dynamic Content and Interpolation

// In translation file
export default {
	welcome_message: 'Welcome, ${name}!',
	item_count: 'You have ${count} items'
}

// In component
const { t } = useTranslation()
t('welcome_message', { name: 'John' })

4.4 Quality Guidelines

  • Translation Completeness: In all supported language files, all keys must have corresponding translations.
  • Context: When words are ambiguous, accurate translations must be provided based on context.
  • Avoid Hardcoding: In React components, never hardcode visible Chinese or English characters; they must be extracted to locale files.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Maintain package-level `agentmap.md` files as outline-level maps of the real file tree and core responsibilities. Use when package structure or responsibility boundaries change and the corresponding `agentmap.md` must be created or updated.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

MatrixAges/polywise6622026년 6월 11일 업데이트

Guides the generation, reading, and updating of agentmap.md files. This skill ensures a consistent and up-to-date codebase map for AI Agents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

MatrixAges/polywise6622026년 6월 11일 업데이트

Interacts with local browser via Chrome DevTools Protocol (only triggered after user explicitly requests to inspect, debug, or interact with pages open in Chrome)

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

MatrixAges/polywise6622026년 6월 11일 업데이트

css

무료

Guides styling implementation using TailwindCSS + CSS Modules. Triggered when handling component styles, layout design, or CSS patterns.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

MatrixAges/polywise6622026년 6월 11일 업데이트

Specialized for translating document files and their content into English. Triggered when localization, translation, or converting Chinese documents to English is requested.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

MatrixAges/polywise6622026년 6월 11일 업데이트

Guides using eRPC (electron-tRPC) for inter-process communication (IPC) between Electron main and renderer processes. Triggered when handling Electron IPC or tRPC-based systems.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

MatrixAges/polywise6622026년 6월 11일 업데이트

MatrixAges의 스킬 모두 보기

이 스킬의 문제 신고