- prepare list of php files
readarray -d '' -t PHP_SOURCES < <(find . -name '*.php' -print0)

- read files from prepared list
xgettext "${PHP_SOURCES[@]}" -o ./locales/messages.pot -L PHP --default-domain=dlteams --add-comments=TRANS --from-code=UTF-8 --force-po --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t --keyword=_ex:1c,2,3t --keyword=_sx:1c,2,3t --keyword=_nx:1c,2,3,5t

- create initial 'po' files
msginit --no-translator -l fr_FR -o ./locales/fr_FR.po -i ./locales/messages.pot
msginit --no-translator -l en_GB -o ./locales/en_GB.po -i ./locales/messages.pot
- update 'po' files from 'pot' files
msgmerge --update ./locales/fr_FR.po ./locales/messages.pot --backup=off
msgmerge --update ./locales/en_GB.po ./locales/messages.pot --backup=off
- create 'mo' files
msgfmt ./locales/fr_FR.po  --output-file=./locales/fr_FR.mo
msgfmt ./locales/pl_PL.po --output-file=./locales/pl_PL.mo

