Пример #1
0
     *
     * @return string the translated phrase.
     */
    public static function ngettext($singular_message, $plural_message, $number)
    {
        return dngettext(CME::GETTEXT_DOMAIN, $singular_message, $plural_message, $number);
    }
    // }}}
    // {{{ public static function setupGettext()
    public static function setupGettext()
    {
        $path = '@DATA-DIR@/CME/locale';
        if (substr($path, 0, 1) === '@') {
            $path = __DIR__ . '/../locale';
        }
        bindtextdomain(CME::GETTEXT_DOMAIN, $path);
        bind_textdomain_codeset(CME::GETTEXT_DOMAIN, 'UTF-8');
    }
    // }}}
    // {{{ private function __construct()
    /**
     * Don't allow instantiation of the CME object
     *
     * This class contains only static methods and should not be instantiated.
     */
    private function __construct()
    {
    }
}
CME::setupGettext();