Recursive xgettext?

前端 未结 5 1898
故里飘歌
故里飘歌 2021-02-02 02:35

How can I compile a .po file using xgettext with PHP files with a single command recursively?

My PHP files exist in a hierarchy, and the straight xget

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-02 03:11

    Here's a solution for Windows. At first, install gettext and find from the GnuWin32 tools collection.

    • http://gnuwin32.sourceforge.net/packages/gettext.htm
    • gnuwin32.sourceforge.net/packages/findutils.htm

    You can run the following command afterwards:

    find /source/directory -iname "*.php" -exec xgettext -j -o /output/directory/messages.pot {} ;
    

    The output file has to exist prior to running the command, so the new definitions can be merged with it.

提交回复
热议问题