Skip to content

Instantly share code, notes, and snippets.

@pboos
Created November 7, 2012 22:36
Show Gist options
  • Save pboos/4034989 to your computer and use it in GitHub Desktop.
Save pboos/4034989 to your computer and use it in GitHub Desktop.
PHP: gettext
$loc->compileAll();
$loc->createGettextPotFor(__FILE__);
require_once "includes/Localization.class.php";
$loc = new Localization;
$loc->setDomain("test");
$loc->setLocale("de_DE");
echo $loc->_("This is a test!"); // translates "This is a test!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment