gt-node@0.6.0
Overview
gt-node now has tx() — a function for translating strings at runtime. Pass any string to tx() and get back a translated version, with no build step needed.
This enables server-side translation of dynamic content: user-generated text, database values, API responses, or anything that isn't known ahead of time.
Usage
Basic
import { tx } from 'gt-node';
const translated = await tx('Processing complete');With variables
const translated = await tx('Hello, {name}!', { name: 'María' });Specifying a locale
const status = await tx('Order shipped', { $locale: 'ja' });