Introduction

This package helps to convert old i18next translation resources to the new i18next v4 json format. (It will only handle keys with the default pluralSeparator _
)
Online version
There's also a web version you can directly use here.
Getting started
Source can be loaded via npm.
$ npm install i18next-v4-format-converter
Usage via code:
import { transformNamespace } from 'i18next-v4-format-converter'
const transformed = transformNamespace('en', {
someKey: 'normal',
different: 'normal two',
myKey: 'singular key',
myKey_plural: 'plural key'
})
for Deno:
import { transformNamespace } from 'https://deno.land/x/i18next_v4_format_converter/index.js'
const transformed = transformNamespace('ar', {
someKey: 'normal',
different: 'normal two',
myKey_0: 'no keys',
myKey_1: 'one key',
myKey_2: 'two keys',
myKey_3: 'few {{count}} keys',
myKey_4: 'many {{count}} keys',
myKey_5: 'other {{count}} keys'
})
Usage via CLI:
npx i18next-v4-format-converter -i /Users/user/my/input -o /Users/user/my/output
npm install i18next-v4-format-converter -g
i18next-v4-format-converter -i /Users/user/my/input -o /Users/user/my/output
Make sure your folder structure looks like this:
└── language
└── namespace.json
i.e.
├── en
│ ├── translation.json
│ └── common.json
└── de
├── translation.json
└── common.json
From the creators of i18next: localization as a service - locize.com
A translation management system built around the i18next ecosystem - locize.com.

With using locize you directly support the future of i18next.