Skip to content

i18n: v5.0.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 11:49
159c276

@routup/i18n 5.0.0 moves request translation to ilingo v6. These notes cover the changes since i18n-v4.0.0.

📣 Some News

This release requires ilingo@^6.2.1 and routup@^6.1.0. Upgrade the plugin and its peers together; translator calls and in-memory catalog setup need the changes below.

👀 Highlights

🌍 Use namespaces with ilingo v6

Translator calls now identify their translation namespace with namespace instead of group. Update each call to keep it pointing at the same translations; interpolation data still goes in data.

 const t = useTranslator(event);
-t({ group: 'app', key: 'greeting', data: { name: 'Peter' } });
+t({ namespace: 'app', key: 'greeting', data: { name: 'Peter' } });

The updated MemoryStore examples build their catalog with ilingo's defineCatalog, defineLocale, defineNamespace, and defineTranslations helpers. Adapt existing nested-object setup to this structure:

import {
    MemoryStore,
    defineCatalog,
    defineLocale,
    defineNamespace,
    defineTranslations,
} from 'ilingo';
import { i18n } from '@routup/i18n';

const store = new MemoryStore({
    data: defineCatalog([
        defineLocale('en', [
            defineNamespace('app', [
                defineTranslations({ greeting: 'Hello, my name is {{name}}' }),
            ]),
        ]),
        defineLocale('de', [
            defineNamespace('app', [
                defineTranslations({ greeting: 'Hallo, mein Name ist {{name}}' }),
            ]),
        ]),
    ]),
});

// Register on your routup App before routes that call useTranslator(event).
router.use(i18n({ store }));

📖 Quick start and translator examples at this release

⚙️ Keep plugin options separate from ilingo configuration

The plugin's options object now accepts only store and locale. You can still supply a locale string or a synchronous/asynchronous per-request locale function. For other ilingo configuration, construct an Ilingo instance and pass it directly instead of putting those options in i18n({ ... }).

Warning

The options-object path constructs ilingo with only store; it does not forward other ilingo options. Move any such configuration to your own instance.

import { Ilingo } from 'ilingo';
import { i18n } from '@routup/i18n';

// Reuse the store above. Configure any additional ilingo options here.
const instance = new Ilingo({ store });
router.use(i18n(instance));

📖 Plugin overloads and configuration handling at this release

⚠️ Heads-Up Before Upgrading

Change What to do
Peer dependencies are now ilingo@^6.2.1 and routup@^6.1.0 Upgrade both peers alongside @routup/i18n.
Translator context uses namespace, not group Rename group in translator calls.
In-memory catalog setup follows ilingo v6 Adapt your MemoryStore data to the catalog helpers shown above.
Plugin options accept only store and locale Pass a configured Ilingo instance when you need other ilingo options.

⬆️ Upgrading

npm install @routup/i18n@^5.0.0 ilingo@^6.2.1 routup@^6.1.0

Apply the migration steps above, then check your catalog setup and translator calls against the versioned usage example.

👉 Changelog

5.0.0 (2026-11-08)

⚠ BREAKING CHANGES

  • i18n: the ilingo peer dependency is now ^6.2.1. The translator context uses namespace instead of group, and plugin options only accept store and locale; pass an Ilingo instance for other ilingo options.

Features

  • i18n: upgrade to ilingo v6 (c8bb6c5)

Bug Fixes

  • deps: bump the minorandpatch group across 1 directory with 16 updates (#851) (135bf8f)