NAME

po - GNU PO file manager

SYNOPSIS

po [ --debug|--nodebug, --verbose|--noverbose, -v, --help, --man]

Options

Basic options:
--add                   Add an msgsid/msgstr entry in the po file
--as-po                 Write the file as a po file
--as-json               Write the po file as json on the STDOUT
--compile               Create a machine object file (.mo)
--domain                The po file domain
--dump                  Dump the PO file in a format suitable for a .po file
--init                  Create an initial po file such as .pot
--sync                  Synchronise a GNU PO file with another one

--bugs-to               Sets the value for the meta field C<Report-Msgid-Bugs-To>
--charset               Sets the character encoding value in C<Content-Type>
--created-on            Sets the value for the meta field C<POT-Creation-Date>
--domain                The domain, such as C<com.example.api>
--encoding              Sets the value for the meta field C<Content-Transfer-Encoding>
--header                The string to be used as the header for the C<.po> file only.
--lang                  The locale to use, such as en_US
--msgid                 The C<msgid> to add
--msgstr                The localised text to add for the given C<msgid>
--output                The output file
--output-dir            Output directory
--overwrite             Boolean. If true, this will allow overwriting existing file
--po-debug              Integer representing the debug value to be passed to L<Text::PO>
--pot                   The C<.pot> file to be used as a template in conjonction with --init
--project               Sets the value for the meta field C<Project-Id-Version>
--revised-on            Sets the value for the meta field C<PO-Revision-Date>
--settings              The settings json file containing default values
--team                  Sets the value for the meta field C<Language-Team>
--translator            Sets the value for the meta field C<Last-Translator>
--tz, --time-zone, --timezone Sets the time zone to use for the date in C<PO-Revision-Date> and C<POT-Creation-Date>
--version               Sets the version to be used in the meta field C<Project-Id-Version>

Standard options:
-h, --help              display this help and exit
-v                      display version information and exit
--debug                 Enable debug mode
--nodebug               Disable debug mode
--help, -?              Show this help
--man                   Show this help as a man page
--verbose               Enable verbose mode
--noverbose             Disable verbose mode

VERSION

v0.2.1

OPTIONS

--add

Adds an msgid and msgstr pair to the po file

po --add --msgid "Hello!" --msgstr "Salut !" --output fr_FR/LC_MESSAGES/com.example.api.po

--as-json

Takes a po file and transcode it as a json po file

po --as-json --output fr_FR/LC_MESSAGES/com.example.api.json fr_FR.po

--as-po

Takes a .mo or .json file and transcode it to a po file

po --as-po --output fr_FR.po ./fr_FR/com.example.api.json

--bugs-to

The string to be used for the PO file header field Bugs-To

--charset

The PO file character set. This should be utf-8

--compile

Takes a po file and compiles it into a binary file wth extension mo

po --compile ./fr_FR/com.example.api.json
# Will create ./fr_FR/com.example.api.mo

--create-on

The PO file creation date. This can be an ISO 8601 date, or a unix timestamp, or even a relative date such as +1D. See "_set_get_datetime" in Module::Generic for more information

--domain

The PO file domain

po --init --domain com.example.api ./fr_FR/com.example.api.po

--dump

Dump the data contained as a GNU PO file to the STDOUT

po --dump /some/file.po >new_file.po
# Maybe?
diff /some/file.po new_file.po

--encoding

The PO file encoding. This defaults to 8bit. There is no reason to change this.

--header

The PO file meta information header

--init

Init a new PO file

po --init --domain com.example.api --lang fr_FR ./fr_FR/com.example.api.po
# then you can convert it as a json file
po --as-json --output ./fr_FR/com.example.api.json ./fr_FR/com.example.api.po

--lang

The PO file locale language

po --init --domain com.example.api --lang fr_FR ./fr_FR/com.example.api.po

--msgid

The localised string original text.

--msgstr

The localised string

--output

--output-dir

The output directory. For example to read multiple po file and create their related mo files under a given directory:

po --compile --output-dir ./en_GB/LC_MESSAGES en_GB.*.po

This will read all the po files for language en_GB as selected in write their related mo files under ./en_GB/LC_MESSAGES. This directory will be created if it does not exist. The domain will be derived from the po file.

--overwrite

Boolean. If true, this will allow overwriting existing PO file. Default is false

--po-debug

An integer value to set the level of debugging. Default is o (no debugging enabled)

--pot

The PO template file to use

--project

The PO file project name

--revised-on

The PO file revision date. This can be an ISO 8601 date, or a unix timestamp, or even a relative date such as +1D. See "_set_get_datetime" in Module::Generic for more information

--settings

The file path to the settings.json json file containing all the default values

This is convenient to set various default values rather than specifying each of of them as option

po --init --settings /some/where/settings.json --domain com.example.api --lang fr_FR ./fr_FR/com.example.api.po

--sync

Synchronise a PO file based on another (the source), adding any missing msgid and msgstr resources it finds in the source file.

For example, to synchronise a Japanese PO file based on its English equivalent:

po --sync --output ./locale/ja_JP/LC_MESSAGES/com.example.api.json ./locale/en_GB/LC_MESSAGES/com.example.api.json

--team

The team in charge of this PO file maintenance

--translator

The PO file Translator field containing the name of the person or group in charge of the translation for this file.

--tz, --time-zone, --timezone

The time zone to use in the PO file meta information header

--version

Displays this utility version number and quits.

--help

Print a short help message.

--debug

Enable debug mode with considerable verbosity

--nodebug

Disable debug mode.

--verbose

Enable verbose mode.

--noverbose

Disable verbose mode.

--man

Print this help as man page.

DESCRIPTION

This program takes optional parameters and process GNU PO files.

GNU PO files are localisation or l10n files. They can be used as binary after been compiled, or they can be converted to json using this utility which then can read the json data instead of parsing the po files, making it faster to load.

EXAMPLE

po [--dump, --debug|--nodebug, --verbose|--noverbose, -v, --help, --man] /some/file.po

AUTHOR

Jacques Deguest <jack@deguest.jp>

COPYRIGHT

Copyright (c) 2020-2021 DEGUEST Pte. Ltd.