https://github.com/rgglez/gettext-po2json
Converts a PO file into a gettext-parser JSON format
https://github.com/rgglez/gettext-po2json
converter gettext gettext-po json perl perl5 svelte-i18n-gettext
Last synced: about 4 hours ago
JSON representation
Converts a PO file into a gettext-parser JSON format
- Host: GitHub
- URL: https://github.com/rgglez/gettext-po2json
- Owner: rgglez
- License: apache-2.0
- Created: 2025-09-02T03:08:30.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2026-02-03T04:53:31.000Z (5 months ago)
- Last Synced: 2026-02-03T18:27:21.955Z (5 months ago)
- Topics: converter, gettext, gettext-po, json, perl, perl5, svelte-i18n-gettext
- Language: Perl
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gettext-po2json
[](https://www.apache.org/licenses/LICENSE-2.0)





This Perl script converts a [PO](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) file into a JSON JED-like file as produced by [gettext-parser](https://github.com/smhg/gettext-parser), suitable for [svelte-i18n-gettext](https://www.github.com/rgglez/svelte-i18n-gettext).
## Usage
```bash
perl po2json.pl --po messages.po --json messages.json --context app
```
- `--po` the source PO file.
- `--json` the destination JSON file.
- `--context` the default context if there's no one present. Optional.
## Dependencies
```bash
cpan install JSON::PP Locale::PO Getopt::Long File::Temp
```
- `JSON::PP`
- `Locale::PO`
- `Getopt::Long`
- `File::Temp`
## License
Copyright 2026 Rodolfo González González.
Licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license. Read the [LICENSE](LICENSE) file.