Generate a string file from json. You can generate strings and xml from json
$ git clone [email protected]:t-osawa-009/JSONToString.git
$ cd JSONToString
$ make install
$ brew install mint
$ mint install t-osawa-009/JSONToString
- Prepare the json that will be the original data of the string.
#Strings.json
[
{
"key": "hoge",
"key_android": "hoge",
"key_ios": "hoge",
"value_android": "hoge",
"value_ios": "hoge"
},
]
- Added
.JSONToString.yml
to set the generation method.
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
- Execute the command.
$ JSONToString --json_path Strings.json
- You can customize the way files are generated by setting the
.JSONToString.yml
. key
keyvalue_key
key valueoutput
File generation pathformat
.strings or .xmlsort
(optional) asc or desc
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
- 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.
JSONToString is released under the MIT license. See LICENSE for details.