i18n helper for translating strings in RunJS, based on the current context language. Suitable for inline text such as buttons, titles, and hints.
| Parameter | Type | Description |
|---|---|---|
key | string | Translation key or template with placeholders (e.g. Hello {{name}}, {{count}} rows) |
options | object | Optional. Interpolation variables (e.g. { name: 'Alice', count: 5 }) or i18n options (defaultValue, ns) |
defaultValue is provided, it may return the key itself or the interpolated string.{{var}} in the key and pass variables in options.ctx.t strings are extracted for centralized translation management.When translation resources are split by namespace, use ns to specify which namespace to search: