Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pittersnider/ji18n

Internationalize JSON Objects
https://github.com/pittersnider/ji18n

i18n internationalization json-api nodejs-library nodejs-modules npm-module

Last synced: about 1 month ago
JSON representation

Internationalize JSON Objects

Awesome Lists containing this project

README

        

# 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:
```json
{
"quotes": [{
"$": {
"en": "This is an english and popular quote",
"pt": "Esta é uma frase portuguesa e popular"
}
}]
}
```

API:
```javascript
'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'] }
```