Skip to content

Generate a string file from json. You can generate strings and xml from json

License

Notifications You must be signed in to change notification settings

t-osawa-009/JSONToString

Repository files navigation

JSONToString

Generate a string file from json. You can generate strings and xml from json

Installation

Makefile

$ git clone [email protected]:t-osawa-009/JSONToString.git
$ cd JSONToString
$ make install
$ brew install mint
$ mint install t-osawa-009/JSONToString

Usage

  1. 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"
    },
]
  1. 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
  1. Execute the command.
$ 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
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

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.

About

Generate a string file from json. You can generate strings and xml from json

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published