-
-
Save anonymous/2a2fccdb72f02fef15847fbc633a24aa to your computer and use it in GitHub Desktop.
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
<? | |
$locale = 'ru'; | |
$domain = 'mydomain'; | |
$results = putenv("LC_ALL=$locale"); | |
if (!$results) { | |
exit ('putenv failed'); | |
} | |
$results = setlocale(LC_ALL, $locale); | |
if (!$results) { | |
exit ('setlocale failed: locale function is not available on this platform, or the given local does not exist in this environment'); | |
} | |
$results = bindtextdomain($domain, "/locale"); | |
echo 'new text domain is set: ' . $results. "\n"; | |
$results = textdomain($domain); | |
echo 'current message domain is set: ' . $results. "\n"; | |
$results = gettext("This is a text!"); | |
if ($results === "This is a text!") { | |
echo "original English was returned. Something wrong\n"; | |
} | |
echo $results . "\n"; | |
die(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment