Last active
October 9, 2018 17:00
-
-
Save kadimi/a3a33a44a7461cb7b6037dcfd1967597 to your computer and use it in GitHub Desktop.
Shell command to create pot file for WordPress themes or plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -iname "*.php" | xargs xgettext \ | |
--language=PHP \ | |
--package-name=Example \ | |
--package-version=1.0.0 \ | |
--from-code=UTF-8 \ | |
--keyword="__" \ | |
--keyword="__ngettext:1,2" \ | |
--keyword="__ngettext_noop:1,2" \ | |
--keyword="_c,_nc:4c,1,2" \ | |
--keyword="_e" \ | |
--keyword="_ex:1,2c" \ | |
--keyword="_n:1,2" \ | |
--keyword="_n_noop:1,2" \ | |
--keyword="_nx:4c,1,2" \ | |
--keyword="_nx_noop:4c,1,2" \ | |
--keyword="_x:1,2c" \ | |
--keyword="esc_attr__" \ | |
--keyword="esc_attr_e" \ | |
--keyword="esc_attr_x:1,2c" \ | |
--keyword="esc_html__" \ | |
--keyword="esc_html_e" \ | |
--keyword="esc_html_x:1,2c" \ | |
--no-wrap \ | |
--sort-by-file \ | |
-o languages/example.pot \ | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment