UI strings in @gorules/jdm-editor are hardcoded in English ('Search nodes', 'Expression...', 'Field label', etc.), making the editor hard to embed in localized products.
Proposing two optional props on the existing JdmConfigProvider (verified against v1.51.5):
import deDE from 'antd/locale/de_DE';
const messages = {
// graph-nodes.tsx → <Input placeholder='Search nodes' />
'graph.nodes.searchPlaceholder': 'Knoten suchen',
// expression-builder.tsx → <Input placeholder='Expression...' />
'expression.builder.placeholder': 'Ausdruck...',
// input-field-edit.tsx / output-field-edit.tsx → <Input placeholder='Field label' />
'decisionTable.field.labelPlaceholder': 'Feldbezeichnung',
};
<JdmConfigProvider locale={deDE} i18n={{ messages }}>
<DecisionGraph value={graph} onChange={setGraph} />
</JdmConfigProvider>
i18n.messages — flat Record<string, string>. Internal t(key, 'English fallback') helper means missing keys (or no provider at all) render today's English. Fully backward-compatible.
locale — forwarded to the antd ConfigProvider already used internally, so antd's own strings (DatePicker, Empty, etc.) localize too.
Why minimal: no new dependencies, no structural refactor — just a small I18nContext + useI18n() hook, and each string becomes t('key', 'English') one site at a time. Strings can be migrated incrementally per component (Decision Graph → Decision Table → Expression nodes → CodeEditor → simulator), each step independently shippable.
UI strings in
@gorules/jdm-editorare hardcoded in English ('Search nodes','Expression...','Field label', etc.), making the editor hard to embed in localized products.Proposing two optional props on the existing
JdmConfigProvider(verified against v1.51.5):i18n.messages— flatRecord<string, string>. Internalt(key, 'English fallback')helper means missing keys (or no provider at all) render today's English. Fully backward-compatible.locale— forwarded to the antdConfigProvideralready used internally, so antd's own strings (DatePicker, Empty, etc.) localize too.Why minimal: no new dependencies, no structural refactor — just a small
I18nContext+useI18n()hook, and each string becomest('key', 'English')one site at a time. Strings can be migrated incrementally per component (Decision Graph → Decision Table → Expression nodes → CodeEditor → simulator), each step independently shippable.