Recursive xgettext?

前端 未结 5 1906
故里飘歌
故里飘歌 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条回答
  •  北恋
    北恋 (楼主)
    2021-02-02 03:19

    For WINDOWS command line a simpe solution is:

     @echo off
    echo Generating file list..
    dir html\wp-content\themes\wpt\*.php /L /B /S > %TEMP%\listfile.txt
    echo Generating .POT file...
    xgettext -k_e -k__ --from-code utf-8  -o html\wp-content\themes\wpt\lang\wpt.pot -L PHP --no-wrap -D html\wp-content\themes\wpt -f %TEMP%\listfile.txt
    echo Done.
    del %TEMP%\listfile.txt
    

提交回复
热议问题