Roots Discourse

POT generation: Missing options

sage9

#1

The resulting POT file using the pot script
(https://roots.io/sage/docs/theme-localization/)
can be used for translating and saving a PO file.

The PO file doesn’t contain the necessary options for updating the translations directly from that PO file (which already contains all the translated strings).
What options have to be missed - and can the pot script be modified to include these options?


#2

What are the options are you mention? I’m using Poedit and I can update the po file from script generated pot file whithout problems.


#3

The following npm script is used:

"pot": "mkdir -p ./resources/lang && find ./resources ./app -iname '*.php' | xargs xgettext --add-comments=TRANSLATORS --force-po --from-code=UTF-8 --default-domain=de_DE -k__ -k_e -k_n:1,2 -k_x:1,2c -k_ex:1,2c -k_nx:4c,12 -kesc_attr__ -kesc_attr_e -kesc_attr_x:1,2c -kesc_html__ -kesc_html_e -kesc_html_x:1,2c -k_n_noop:1,2 -k_nx_noop:3c,1,2, -k__ngettext_noop:1,2 -o resources/lang/example.pot && find ./resources -iname '*.blade.php' | xargs xgettext --language=Python --add-comments=TRANSLATORS --force-po --from-code=UTF-8 --default-domain=de_DE -k__ -k_e -k_n:1,2 -k_x:1,2c -k_ex:1,2c -k_nx:4c,12 -kesc_attr__ -kesc_attr_e -kesc_attr_x:1,2c -kesc_html__ -kesc_html_e -kesc_html_x:1,2c -k_n_noop:1,2 -k_nx_noop:3c,1,2, -k__ngettext_noop:1,2 -j -o resources/lang/example.pot"

When the resulting POT file is opened in POEdit, saved as a translation file and then a source update is tried, POEdit tries to scan all files, (also node_modules) and hangs. The catalog options are empty.