Skip to content

Instantly share code, notes, and snippets.

@elebescond
Created December 5, 2011 10:24
Show Gist options
  • Save elebescond/1433137 to your computer and use it in GitHub Desktop.
Save elebescond/1433137 to your computer and use it in GitHub Desktop.
Generate a pot template from a wordpress theme - xgettext
find . -iname "*.php" > /tmp/my_theme_file_list.txt
# new template
xgettext --from-code=utf-8 -d my_theme -f /tmp/my_theme_file_list.txt --keyword=__ -o languages/my_theme.pot
# update template
xgettext --from-code=utf-8 -d my_theme -j -f /tmp/my_theme_file_list.txt --keyword=__ -o languages/my_theme.pot
@s3rgeym
Copy link

s3rgeym commented Jun 30, 2021

$ xgettext --from-code=utf-8 --keyword=__ -o ./wp-content/languages/themes/THEME-ru_RU.po ./wp-content/themes/THEME/*.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment