1.1.0 • Published 3 years ago

po-transformer v1.1.0

Weekly downloads
19
License
MIT
Repository
github
Last release
3 years ago

📚Transforms JSON-files to PO-Files ↔️ PO-Files to JSON-files

Published Downloads

Motivation

In some projects, I use react-intl to internationalize them and support multi-languages. React-intl supports flatted objects as JSON-files divided into separated named-files like en_US.json or de_DE.json.

Most of my clients use POEdit to manage multi-languages in their projects. And most translations agency known and used this tool too.

For these reasons I need something to transform flatted objects as JSON-files to PO-Files to open with POEdit - so this tool/repository was born.

Features

  • Transforms an existing JSON-File to a PO-File
  • Transforms an existing PO-File to a JSON-File

Usage

Transforms an existing JSON-File to a PO-File

$ npx po-transformer po --input examples/testData.json --output examples/testData.po

# Optional
$ cat examples/testData.po
…
#. firstEntry
#: First Entry
#| First Entry
msgid "firstEntry"
msgstr "First Entry"
…

Transforms an existing PO-File to a JSON-File

$ npx po-transformer json --input examples/testData.po --output examples/testData.json

# Optional
$ cat examples/testData.json
{
  …
  "firstEntry": "First Entry",
  "firstEntry.item1": "First Entry - 1. Item",
  "firstEntry.item2": "First Entry - 2. Item",
  …
}

Displays the usage

$ npx po-transformer --help

Known Bugs

The current situation of this project is, that it works for my workflow and situations only. It's a very raw and straightforward implementation tailored exactly to what I need.

License

MIT License

1.1.0

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago