ワンクリックで
i18n-messaging
// Manage and maintain i18n messaging or copy for Daedalus multi-language support.
// Manage and maintain i18n messaging or copy for Daedalus multi-language support.
| 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
Add, update, validate and verify theme files using built-in package.json commands and utilities.
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.
Create or update Storybook stories for Daedalus React components. Use this when asked to write stories, visual tests, storybook entries, or component demos for new or existing features.
Encode and decode bech32 strings using the local bech32 CLI.
Diagnose cardano-cli: version, era-prefixed vs legacy syntax, network flags. Produces compatibility report.
Plutus script guidance: datums, redeemers, collateral, reference scripts. Templates only—use operator to execute.