We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

What happened to the Phalcon GetText translation component in the incubator?

I've been hoping to implement some level of translations using the Phalcon GetText component in the incubator.

However 7 days ago, it appears that the GetText adapter was cleared out with a commit labelled "Released 2.0.0".

https://github.com/phalcon/incubator/commit/9ab12d93c66e3b7813a585209d12aa1c67d05eb4

Does anyone know what the future of GetText is under Phalcon 2.0?

iam implement gettext on phalcon:

in service.php

    $di->set('voltService', function ($view, $di) use ($config) {
    $voltOptions = array();
    $volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
    $compiler = $volt->getCompiler();

    if ($config->application->debug) {
        $voltOptions['compileAlways'] = true;
        $volt->setOptions($voltOptions);
    }
    // Funcion para que volt reconozca multilenguaje
    $compiler->addFunction('_', function($resolvedArgs) {
        return 'gettext(' . $resolvedArgs . ')';
    });
    $compiler->addFilter('ucf', 'ucfirst');
    $compiler->addFilter('flv', 'floatval');
    return $volt;
});

in my boostrap:

    $lang_default_client = $s_lang_cookie;
putenv("LANG=$lang_default_client");
setlocale(LC_ALL, 'C.UTF-8');
bindtextdomain("messages", APP_PATH . "public/locale/$lang_default_client");
bind_textdomain_codeset('messages', 'UTF-8');
textdomain("messages");

in my views:

{{ _('Enviar email al grupo de soporte') }}

;)