用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/input-output-hk/daedalus --skill i18n-messaging命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Add, update, validate and verify theme files using built-in package.json commands and utilities.
Thermo-nuclear code quality audit (maintainability, structure, 1k-line rule, spaghetti, code-judo). Invoked via Task after a parent gathers diff and file contents. Run an extremely strict maintainability review for abstraction quality, giant files, and spaghetti-condition growth. Use for a thermo-nuclear code quality review, thermonuclear review, deep code quality audit, or especially harsh maintainability review.
Create Cucumber BDD end-to-end tests for new features, enhancements, or updates. Use this when asked to write e2e tests, acceptance tests, feature files, step definitions, or Cucumber scenarios for Daedalus.
正在显示 SKILL.md
基于 SOC 职业分类
| name | i18n-messaging |
| description | Manage and maintain i18n messaging or copy for Daedalus multi-language support. |
| user-invocable | true |
Manage and maintain i18n messaging for Daedalus multi-language support
Handles message extraction, validation, localization workflows, and schema compliance for Daedalus's internationalization system. Supports English (en-US) and Japanese (ja-JP) locales using react-intl and Format.js.
Messages in Daedalus follow a structured format using defineMessages() from react-intl:
{
messageKey: {
id: "namespace.context.messageKey", // Unique identifier with dot notation
defaultMessage: "!!!Message text with placeholders",
description: "Context/description for translators",
values?: Record<string, any> // Runtime variable placeholders
}
}
namespace.context.messageKey (dot-separated)!!! in defaultMessageglobal.errors.fieldIsRequiredapi.errors.IncorrectPasswordErrorglobal.ada.nameMessages with dynamic content use curly braces:
knownMnemonicWordCount: {
id: 'global.info.knownMnemonicWordCount',
defaultMessage: '!!!{actual} of {required} words entered',
values: { actual: 5, required: 12 }
}
Extract all i18n messages from source code to generate message catalog.
yarn i18n:extract
What it does:
source/**/*.{ts,tsx} filesdefineMessages() and <FormattedMessage /> calls.d.ts TypeScript declaration filestranslations/messages.jsonWhen to use:
defineMessages()i18n:checki18n:manage workflowOutput format:
[
{
"path": "source/main/ipc/handlers.ts",
"descriptors": [
{
"id": "global.errors.fieldIsRequired",
"defaultMessage": "!!!This field is required.",
"description": "Error message when required fields are left empty."
}
]
}
]
Validate translation files for consistency and completeness against extracted messages.
yarn i18n:check
What it does:
react-intl-translations-manager to manage lifecycleWhen to use:
Validates:
Combined operation: extract messages AND validate translations in one command.
yarn i18n:manage
Equivalent to: yarn i18n:extract && yarn i18n:check
When to use:
check:all verification| Locale | Language | Directory |
|---|---|---|
| en-US | English | source/renderer/app/i18n/locales/en-US.json |
| ja-JP | Japanese | source/renderer/app/i18n/locales/ja-JP.json |
source/renderer/app/i18n/locales/
├── defaultMessages.json # All extracted messages (auto-generated)
├── en-US.json # English translations (English only)
├── ja-JP.json # Japanese translations
├── whitelist_en-US.json # Approved en-US messages
├── whitelist_ja-JP.json # Approved ja-JP messages
└── terms-of-use/ # Locale-specific documents
defineMessages() or <FormattedMessage /> in source codenamespace.context.messageKeydescription for translators!!!yarn i18n:extract to register new messagesDo:
wallet.send.confirmButtonDon't:
Messages with runtime values use curly braces:
// Define message with placeholder
notEnoughFunds: {
id: 'wallet.errors.notEnoughFunds',
defaultMessage: '!!!Remaining balance: {balance} ADA',
description: 'Error when insufficient funds'
}
// Use at runtime
<FormattedMessage
id="wallet.errors.notEnoughFunds"
defaultMessage="Remaining balance: {balance} ADA"
values={{ balance: walletBalance }}
/>
yarn i18n:extract after code changesyarn i18n:check to validatecheck:all before committingtranslations/messages.json and locale files!!! Placeholdersyarn i18n:manage seeds missing locale entries from defaultMessage, so new keys in en-US.json and ja-JP.json can be written with the !!! prefix.!!! in locale files as a new or untranslated message marker, not polished release copy.en-US.json entries with approved English copy and add real Japanese translations in ja-JP.json before commit.!!! placeholders is acceptable, but document the follow-up translation work explicitly.| File | Purpose |
|---|---|
translations/translation-runner.ts | Validates translations (manages mapping) |
translations/formatter.js | Custom extraction format for Format.js |
translations/messages.json | Extracted message catalog |
source/renderer/app/i18n/global-messages.ts | Global message definitions |
source/renderer/app/i18n/errors.ts | Error message definitions |
source/renderer/app/i18n/types.ts | TypeScript types for messages |
defineMessages() is imported from react-intlsource/**/*.{ts,tsx} (not .d.ts)yarn clear:translations then yarn i18n:extractyarn i18n:manage to refresh stateimport { defineMessages } from 'react-intl';
// In your component file or messages.ts
export const componentMessages = defineMessages({
newMessageKey: {
id: 'feature.component.newMessageKey',
defaultMessage: '!!!Default English text',
description: 'Context for translators explaining where/how this message is used',
},
messageWithPlaceholder: {
id: 'feature.component.messageWithPlaceholder',
defaultMessage: '!!!You have {count} items',
description: 'Message showing item count with placeholder',
},
});
Then run: yarn i18n:manage