Loris icon indicating copy to clipboard operation
Loris copied to clipboard

[multilingual/tools] Add tool to convert LINST file to pot

Open driusan opened this issue 1 month ago • 0 comments

This adds a tool, linst2pot.php, which extracts all of the strings that should be translated for a LINST format instrument into a .pot file for translators.

The tool reads the linst from stdin and writes the pot to stdout.

It also adds a --stdout argument to lorisform_parser to have it print to stdout instead of ip_output.txt, so that it can be composed with a pipe.

To generate pot files for all instruments in the project directory you should be able to do something like:

for file in ../project/instruments/*.linst; do
   instrument=$(basename $file .linst)
   outfile=../project/locale/$instrument.pot
   cat $file | php ./linst2pot.php > $outfile
done

for file in ../project/instruments/*.class.inc; do
   instrument=$(basename $file .class.inc | sed -e 's#NDB_BVL_Instrument_##')
   outfile=../project/locale/$instrument.pot
   echo $file | php ./lorisform_parser.php --stdout 2>/dev/null | php ./linst2pot.php > $outfile
done

and then have them translated.

driusan avatar Dec 10 '25 19:12 driusan