?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");?
?php / / Choix l'allemand putenv("LANG=de"); / / Spécifie la localisation des tables de traduction bindtextdomain("myPHPApp", ". / locale"); / / Choisit le domaine textdomain("myPHPApp"); / / Affiche un message de test print (gettext ("Bienvenue sur mon application PHP"));?