← All @molecule/* packages · App templates
@molecule/api-locales-resource-messageTranslations · i18n · API (Node) · v1.0.1 · Apache-2.0
Locale bond for @molecule/api-resource-message.
npm install @molecule/api-locales-resource-message@molecule/api-locales-resource-message carries the translations for the i18n package on the API (Node) side. Install it beside that package and the i18n core picks the strings up by locale.
import { af, am, ar } from '@molecule/api-locales-resource-message'
import type {
MessageTranslationKey,
MessageTranslations,
} from '@molecule/api-locales-resource-message'Works with: @molecule/api-i18n
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Message resource locale bond for molecule.dev.
Provides type-safe translations for @molecule/api-resource-message's
error and system-message keys. Wire by importing the resource package's
i18n.ts (which calls registerLocaleModule on this package).
Provides translations for the @molecule/api-resource-message package which has 18 translation keys.
79 languages supported: af, am, ar, az, be, bg, bn, bs, ca, cs, cy, da, de, el, en, es, et, eu, fa, fi, fil, fr, ga, gl, gu, ha, he, hi, hr, hu, hy, id, ig, is, it, ja, ka, kk, km, kn, ko, ky, lo, lt, lv, mk, ml, mn, mr, ms, mt, my, nb, ne, nl, pa, pl, pt, ro, ru, si, sk, sl, sq, sr, sv, sw, ta, te, th, tr, uk, ur, uz, vi, yo, zh, zh-TW, zu.
import { af, am, ar } from '@molecule/api-locales-resource-message'
import type {
MessageTranslationKey,
MessageTranslations,
} from '@molecule/api-locales-resource-message'
In an mlcl-scaffolded app, installed locale bonds are registered automatically by the app's i18n setup at startup — installing this package is normally all you need. To register manually (or in a custom app), pass the whole module to registerLocaleModule from @molecule/api-i18n at startup:
import { registerLocaleModule } from '@molecule/api-i18n'
import * as locales from '@molecule/api-locales-resource-message'
registerLocaleModule(locales)
en.ts is the canonical key set — every other language file mirrors its keys. To change or add strings, edit the locale files in this package (add new keys to en.ts first) or merge overrides at runtime with addTranslations(locale, map). Never hand-write translations inline in feature code: features call t(key, values, { defaultValue }) and THIS bond supplies the translations — inline strings bypass every other language.
| Key | English |
|---|---|
message.error.deleteFailed | Failed to delete message |
message.error.editFailed | Failed to edit message |
message.error.listMessagesFailed | Failed to list messages |
message.error.listThreadsFailed | Failed to list threads |
message.error.markReadFailed | Failed to mark thread as read |
message.error.messageNotFound | Message not found or not editable |
message.error.missingMessageId | Message ID is required |
message.error.missingThreadId | Thread ID is required |
message.error.notParticipant | You are not a participant in this thread |
message.error.readThreadFailed | Failed to read thread |
message.error.selfThread | Cannot start a thread with yourself |
message.error.sendFailed | Failed to send message |
message.error.threadCreateFailed | Failed to create thread |
message.error.threadNotFound | Thread not found |
message.error.unreadCountFailed | Failed to get unread count |
message.error.validationFailed | Validation failed |
message.system.conversationStarted | {{name}} started a conversation |
message.system.messageDeleted | This message was deleted |
@molecule/api-resource-message