= 2) { $locale = PLOGGER_LOCALE; } else { $locale = 'en_US'; } $language = strtolower(substr($locale, 0, 2)); $mofile = PLOGGER_DIR.'plog-content/translations/'.$language.'.mo'; // If the mo file does not exist or is not readable, or if the locale is en_US, do not load the mo if (is_readable($mofile) && ($locale != 'en_US')) { $input = new FileReader($mofile); } else { $input = false; } $plog_l10n = new gettext_reader($input); // Return a translated string function plog_tr($text) { global $plog_l10n; if (isset($plog_l10n)) { return $plog_l10n->translate($text); } else { return $text; } } ?>