// Set language to German setlocale(LC_ALL, 'de_DE'); // Specify location of translation tables bindtextdomain("myPHPApp", "/usr/share/i18n/locales/"); // Choose domain textdomain("myPHPApp"); // Translation is looking for in ./locale/de_DE/LC_MESSAGES/myPHPApp.mo now // Print a test message echo gettext("Welcome to My PHP Application"); // Or use the alias _() for gettext() echo _("Have a nice day");