I've tried everything about these links but it still does not work:
- https://forum.phalcon.io/discussion/10159/problem-with-gettext
- https://github.com/phalcon/cphalcon/issues/11311
- https://forum.phalcon.io/discussion/1150/need-help-with-gettext-solved
and more...
I have tried to mimic phanbook settings and it did not work either.
in services.php
$di->set(
'translation',
function () use ($config, $di) {
// force
$code = 'en_US.UTF-8';
if ($language->gettext) {
$trans = new \Phalcon\Translate\Adapter\Gettext([
'locale' => $code,
'directory' => APP_DIR . '/lang',
'defaultDomain' => 'messages',
'category' => LC_MESSAGES
]);
var_dump($trans);
echo "<br>";
// para es que serĂ¡ el centro por ahora no usamos nada
return $trans;
}
}
the var_dump()
object(Phalcon\Translate\Adapter\Gettext)#201 (5) {
["_interpolator":protected]=> object(Phalcon\Translate\Interpolator\AssociativeArray)#200 (0) { }
["_directory":protected]=> string(46) "/usr/share/nginx/dev3.colindar.es/web/app/lang"
["_defaultDomain":protected]=> string(8) "messages"
["_locale":protected]=> string(11) "en_US.UTF-8"
["_category":protected]=> int(5)
}
I try to translate something like that (addFunction
to volt done)
<p>{{ _("hola332") }} Peter</p>
I have the path APP_DIR . "/lang/LC_MESSAGES/en_US.UTF-8/messages.mo"
and .po
fine, translated and with permission.
locale:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
I do not know what else to try