NAME

locale-simple - Scrape translation calls and convert PO files to JSON

VERSION

version 0.200

SYNOPSIS

locale-simple scrape [OPTIONS]
locale-simple po2json [--domain NAME] [--pretty] FILE.po
locale-simple help
locale-simple --version

DESCRIPTION

One command for the Locale::Simple tooling. Exit codes: 0 success, 1 the command failed (message on STDERR), 2 a bad call: missing or unknown command, bad options or arguments (usage on STDERR).

COMMANDS

scrape

Finds the l() family of calls in the Perl, Python, JavaScript, PHP, Go, Rust and Text::Xslate sources below the current directory and writes the result to STDOUT, a .pot template by default. Parse problems are reported on STDERR and do not change the exit code. The options are the ones of Locale::Simple::Scraper (locale-simple scrape --help lists them):

--js EXT, --pl EXT, --py EXT, --php EXT, --go EXT, --rs EXT, --tx EXT

Extra file extensions (comma-separated, repeatable) for the given language.

--ignore REGEX

Skip files whose path matches. Repeatable.

--only REGEX

Use only files whose path matches. Repeatable.

--output FORMAT

po (default), perl, json or yaml (needs the YAML module).

--md5

Replace file names by their MD5 sum.

--no_line_numbers

Leave out the #: location comments.

po2json

Converts a PO file to the JSON data the JavaScript side loads and writes it to STDOUT, followed by a newline. It keeps what msgfmt keeps: no untranslated, fuzzy or obsolete entries. A read or parse error goes to STDERR with exit code 1.

--domain NAME

Wrap the data in { "NAME": ... }. The default is the file name without .po or .pot.

--pretty

Indent the output.

help

Print the usage to STDOUT and exit with 0. --help and -h do the same.

--version

Print locale-simple VERSION.

SEE ALSO

Locale::Simple, Locale::Simple::Scraper, Locale::Simple::PO2JSON

SUPPORT

Issues

Please report bugs and feature requests at https://github.com/Getty/locale-simple/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Torsten Raudssus https://raudssus.de/.

This is free software, licensed under:

The MIT (X11) License