Php Programming Code Examples
Php > Other Code Examples
Gettext
Gettext
<?php
// Set language to German
setlocale(LC_ALL, 'de');
// Specify location of translation tables
bindtextdomain("myPHPApp", "./locale");
// Choose domain
textdomain("myPHPApp");
// Print a test message
print gettext("Welcome to My PHP Application");
// Or use the alias _() for gettext()
print _("Have a nice day");
?>