Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/pittersnider/ji18n
- Owner: pittersnider
- License: mit
- Created: 2018-02-17T15:03:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-17T16:28:40.000Z (almost 7 years ago)
- Last Synced: 2024-04-29T22:14:15.328Z (8 months ago)
- Topics: i18n, internationalization, json-api, nodejs-library, nodejs-modules, npm-module
- Language: JavaScript
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'] }
```