Created
May 20, 2018 16:51
-
-
Save tml/593fdb868354a6f53dceb52cd25f9c34 to your computer and use it in GitHub Desktop.
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
locale/en/LC_MESSAGES: | |
-rw-rw-r-- 1 joey joey 67 May 20 10:38 template.mo | |
-rw-rw-r-- 1 joey joey 28 May 20 10:37 template.po | |
template.po: | |
msgid "foo" | |
msgstr "foobar" | |
locale/it/LC_MESSAGES: | |
total 8 | |
-rw-rw-r-- 1 joey joey 67 May 20 10:38 template.mo | |
-rw-rw-r-- 1 joey joey 28 May 20 10:37 template.po | |
template.po: | |
msgid "foo" | |
msgstr "barbat" | |
myscript.php: | |
<?php | |
setlocale(LC_ALL, 'en_GB.UTF-8'); | |
bindtextdomain ("template", "./locale"); | |
textdomain ("template"); | |
echo _("foo"), "\n"; | |
setlocale(LC_ALL, 'it_IT.UTF-8'); | |
echo _("foo"), "\n"; | |
php -f myscript.php: | |
foobar | |
barbat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
strace -o /dev/stdout -e open -fF php -f myscript.php | grep locale