Skip to content

Instantly share code, notes, and snippets.

@fukata
Created December 25, 2017 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fukata/f37c24649d49ada676516bb48d790711 to your computer and use it in GitHub Desktop.
Save fukata/f37c24649d49ada676516bb48d790711 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
cd app
# th_th
msgfmt -o content/languages/locale/th_th/LC_MESSAGES/messages.mo content/languages/locale/th_th/LC_MESSAGES/messages.po
#!/usr/bin/env bash
cd app
find . -type f |egrep '.*\.(php|tpl|js)$' |grep -v 'templates_compiled' |grep -v 'includes/libs/' > /tmp/gettext_files
xgettext --from-code='UTF-8' --keyword='__' --output=/tmp/app.pot --file /tmp/gettext_files
# th_th
msgmerge -N content/languages/locale/th_th/LC_MESSAGES/messages.po /tmp/app.po > content/languages/locale/th_th/LC_MESSAGES/messages.new.po
mv content/languages/locale/th_th/LC_MESSAGES/messages.new.po content/languages/locale/th_th/LC_MESSAGES/messages.po
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment