Skip to content

Conversation

@driusan
Copy link
Collaborator

@driusan driusan commented Dec 10, 2025

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.

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.
@github-actions github-actions bot added the Language: PHP PR or issue that update PHP code label Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: PHP PR or issue that update PHP code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant