1.0.0 • Published 7 years ago
ji18n v1.0.0
JI18N
Internationalize JSON Objects. This software helps you to convert keys inside JSON Schema. It is util if you have, in an example, multi-language support inside JSON. See above for more examples.
Input:
{
"quotes": [{
"$": {
"en": "This is an english and popular quote",
"pt": "Esta é uma frase portuguesa e popular"
}
}]
}
API:
'use strict'
const ji18n = require('ji18n');
const input = {
"quotes": [{
"$": {
"en": "This is an english and popular quote",
"pt": "Esta é uma frase portuguesa e popular"
}
}]
}
ji18n(input, 'pt' /*, '$ or another key'*/);
// 'input' now is { quotes: ['Esta é uma frase portuguesa e popular'] }
1.0.0
7 years ago