Lessons From Linguistics: i18n Best Practices for Front-End Developers
Interpolating nouns into shared UI strings breaks in translation because many languages have grammar English lacks. Hardcoded word order and punctuation, the `count === 1` pluralization check, CLDR's six plural categories (illustrated with Polish), grammatical gender (French articles and adjective agreement) and declensions all mean a generic `{noun}` placeholder produces wrong sentences. The fix is to translate whole sentences, interpolate only where unavoidable (such as links) and keep those fragments tied to one sentence context. Text should also never be constructed or manipulated in code: no assembling word order, punctuation, line breaks or casing.
Related posts
- Frontend Engineering at Palantir: Engineering Multilingual Collaboration
Palantir mediumAdeptDossier, Palantir's collaborative rich-text editor, gained a read-only translation mode that routes all text through an in-house Language Model Service so content never leaves secure or air-gapped networks. Documents are chunked at the block level (paragraphs, list items, table cells) to balance model context against latency. Only blocks entering the viewport are translated, detected via IntersectionObserver, with batching, debouncing and caching to limit backend load. Translation state lives in a dedicated Redux slice with a per-block cache keyed by element ID, which is invalidated on live edits. Inline formatting is stripped before translation because splitting sentences around bold or link spans breaks grammar, so the translated view is currently plain text.
- Content Creation Copilot - AI-assisted product onboarding
Zalando Engineering mediumAdeptZalando built a copilot that pre-fills product attributes during content onboarding by sending product image URLs and generated prompts to OpenAI GPT models. Copywriters still review and approve every suggestion. A prompt generator builds requests from article masterdata attribute sets. A translation layer maps Zalando's opaque attribute codes to English values and back, and a category mapping layer suppresses attributes that shouldn't apply. Moving from GPT-4 Turbo to GPT-4o improved accuracy, latency and cost, and product-only front images gave the best results. The system reaches about 75% accuracy and enriches around 50,000 attributes per week, though it is weaker on niche fashion terms, which motivated an aggregator service that combines multiple suggestion sources.
- Forays in Fancy Formatting
incident.io mediumAdeptSupporting rich text in incident summaries and updates means translating between Slack's new rich text input and ProseMirror in the dashboard, plus one-way exports to Jira, Confluence, Notion, Google Docs and email, each with different formatting rules. Because Slack only supports single-level lists, incident.io restricted dashboard lists to one level rather than flattening them, keeping the experience consistent. Debrief templates were the hardest case, since an embedded summary might land inside a heading, table or list. Unsupported combinations are handled by "downgrading" the formatting: bullet characters stand in for lists in tables, bold text replaces headings in lists, and inline code replaces code blocks in quotes.
- Help choose the syntax for CSS Nesting
WebKit mediumAdeptThe CSS Working Group is choosing between three candidate syntaxes for native CSS nesting, since Sass-style nesting is impossible: browser parsers would read a nested selector like `element:pseudo` as a `property: value` declaration. Option 3 lets nested rules sit directly in the declaration block but forbids them from starting with a letter, so element selectors need `&` or an `:is()` wrapper. Option 4 adds an optional second block after the declarations that holds only nested rules. Option 5 introduces a dedicated `@nest` at-rule. Side-by-side examples cover basics, nested nesting, media queries and cascade layers, and developers are asked to vote in a survey.
- Behind the scenes: international keyboard shortcuts
Figma mediumAdept
Figma reworked its US-QWERTY-centric keyboard shortcuts to support about 15 international layouts, including German, French AZERTY, Japanese, Swedish and Korean. The work ran into several traps. `"ß".toUpperCase()` returns `SS`, which broke shortcut normalization until the team switched to the capital eszett `ẞ`. Dead keys such as `^` on AZERTY collide with Safari's reordering of keydown and composition events, and Shift plus numpad keys override numlock. Layout detection is heuristic: the desktop app reads OS layout IDs and needed prefix matching after Apple renamed its Japanese layouts, while browsers rely on the experimental Keyboard API. The team stores layout preferences per device in localStorage with a backend fallback, and dropped auto-switching layouts in favour of minimally intrusive onboarding.