-
-
Save leandro/14d5477b2cfb15b22a7fedaa90201c69 to your computer and use it in GitHub Desktop.
Generate a .pot template from a wordpress theme/codebase and update .po files
This file contains 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" > /tmp/my_php_files.txt | |
# new template | |
xgettext --from-code=utf-8 -d my_dir -f /tmp/my_php_files.txt -o languages/my_theme.pot | |
# update template | |
xgettext --from-code=utf-8 -d my_dir -j -f /tmp/my_php_files.txt -o languages/my_theme.pot | |
# To update the already translated .po files and add new strings to them, run: | |
msgmerge --update --no-fuzzy-matching --backup=off lancguages/pt_BR.po languages/my_theme.pot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment