I18n translations

From handsontable/handsontable · View interactive version

I18n translations is an AI agent skill from the GitHub repository handsontable/handsontable. Use when adding user-facing text to Handsontable, creating new language constants, updating translation files, or working with RTL layouts and internationalization

How to use this skill

Skill file

Internationalization and Translations

Route all user-visible strings through the i18n system in src/i18n/.

Adding a language constant

  1. Define it in src/i18n/constants.ts in UPPER_SNAKE_CASE, built from a namespace prefix and key:
export const CONTEXTMENU_ITEMS_ROW_ABOVE = `${CM_ALIAS}.insertRowAbove`;
  1. Add the phrase to every language file in src/i18n/languages/ (20+ locales, e.g. en-US.ts, de-DE.ts), translated: a phrase a file lacks falls back to English, so a translated grid reads it in another language (WCAG 3.1.2). src/i18n/__tests__/languageCompleteness.unit.ts fails on a file that lacks a phrase en-US holds, holds an empty one, or uses a placeholder the English phrase does not have. Each file imports constants as * as C:
[C.CONTEXTMENU_ITEMS_ROW_ABOVE]: 'Insert row above',

Pluralizable strings use an array: ['Remove row', 'Remove rows'].

  1. A new language file also needs the barrel export in src/i18n/languages/index.ts.

Consuming translations

import * as C from '../../i18n/constants';

const label = this.hot.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ROW_ABOVE);

RTL

layoutDirection: 'rtl'. Use logical CSS properties (inset-inline-start in place of left). Test with ar-AR or fa-IR.

IME

Editors handle compositionstart, compositionupdate, compositionend for CJK input; leave composition state untouched when changing editor behavior.

Locale-aware casing

Lowercase cell data with localeLowerCase(value, locale) from src/helpers/string.ts, in place of String.prototype.toLocaleLowerCase (ESLint no-restricted-syntax enforces it). It keeps Turkish/Azeri/Lithuanian special casing, takes the fast toLowerCase() path elsewhere, and does not throw on an invalid locale tag.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.