https://github.com/t-osawa-009/jsontostring
Generate a string file from json. You can generate strings and xml from json
https://github.com/t-osawa-009/jsontostring
and ios locali strin swift swiftpackagemanager
Last synced: about 2 months ago
JSON representation
Generate a string file from json. You can generate strings and xml from json
- Host: GitHub
- URL: https://github.com/t-osawa-009/jsontostring
- Owner: t-osawa-009
- License: mit
- Created: 2020-05-27T12:22:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-28T03:05:32.000Z (almost 5 years ago)
- Last Synced: 2025-01-10T12:50:01.077Z (4 months ago)
- Topics: and, ios, locali, strin, swift, swiftpackagemanager
- Language: Swift
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# JSONToString
Generate a string file from json.
You can generate strings and xml from json## Installation
### Makefile
```sh
$ git clone [email protected]:t-osawa-009/JSONToString.git
$ cd JSONToString
$ make install
```### [Mint](https://github.com/yonaskolb/Mint)
```sh
$ brew install mint
$ mint install t-osawa-009/JSONToString
```## Usage
1. Prepare the json that will be the original data of the string.
```json
#Strings.json
[
{
"key": "hoge",
"key_android": "hoge",
"key_ios": "hoge",
"value_android": "hoge",
"value_ios": "hoge"
},
]
```2. Added `.JSONToString.yml` to set the generation method.
```yml
outputs:
- key: key
value_key: value_ios
output: Strings/Localizable.strings
format: strings
sort: asc
- key: key
value_key: value_android
output: Strings/strings.xml
format: xml
```3. Execute the command.
```sh
$ JSONToString --json_path Strings.json
```## Configuration
- You can customize the way files are generated by setting the `.JSONToString.yml`.
- `key` key
- `value_key` key value
- `output` File generation path
- `format` .strings or .xml
- `sort` (optional) asc or desc
```yml
outputs:
- key: key
value_key: value_ios
output: Strings/Localizable.strings
format: strings
sort: asc
- key: key
value_key: value_android
output: Strings/strings.xml
format: xml
```## Reference Resources
- [Pairs Global iOSでのクールな多言語管理](https://medium.com/eureka-engineering/pairs-global-ios%E3%81%A7%E3%81%AE%E3%82%AF%E3%83%BC%E3%83%AB%E3%81%AA%E5%A4%9A%E8%A8%80%E8%AA%9E%E7%AE%A1%E7%90%86-b91010b063cb)## CONTRIBUTING
- There's still a lot of work to do here. We would love to see you involved. You can find all the details on how to get started in the Contributing Guide.## License
JSONToString is released under the MIT license. See LICENSE for details.