Questions tagged [zend-translate]

Zend_Translate is the Zend Framework's solution for multilingual applications.

Zend_Translate is solution for multilingual applications. is preferred instead of PHP's native functions. Here you can read more about the benefits from using Zend_Translate and how to start using it.

160 questions
2
votes
1 answer

Disable translator for Zend_Form_Element, but not it's validators

I have a Zend_Form_Element_Select object, and about 3k select options. When the customer asked me to look further into optimization possibilities, I did some debug tracing, and noticed, that there were more than 3k calls to…
Janis Peisenieks
  • 4,938
  • 10
  • 55
  • 85
2
votes
1 answer

Zend framework, gettext, poedit and human language in which key strings are written

I'm writing a website using ZendFramework and decided to use the gettext system to internationalize its content. In my views I write string in french and provide a this moment only one file "en.mo" to translate sentences to english. I would like to…
Fluxine
  • 93
  • 1
  • 9
2
votes
1 answer

Zend_Translate in Ajax Calls

I'm currently in the process of localizing a project with Zend_Translate. When trying to use the adapter in a php-file requested by an ajax call, I get the following error message(s): Warning: require_once(Zend/Exception.php): failed to open…
DanceMichi
  • 31
  • 4
2
votes
1 answer

Add prefix to cached ZF2 translation files

I am using ZF2 I18n translator and memcached. Setup is: use Zend\I18n\Translator\Translator; use Zend\Cache\Storage\Adapter\MemcachedResourceManager as MemcachedResourceManager; //=== setup the cache ===// //create a memcached resource…
brian_d
  • 11,190
  • 5
  • 47
  • 72
2
votes
2 answers

Zend framework 2 translator in model

How to get translator in model? Inside view we can get translator using this code $this->translate('Text') Inside controller we can get translator using this code…
S B
  • 1,363
  • 12
  • 21
2
votes
1 answer

Zend Framework 2 translate using gettext a text with variables

How I have to do for translate a string as this, where $user contains the user name? $message = 'Hello ' . $user . ', how are you'; If I translate using the follow code, it don't works. $message = $translator->translate('Hello ' . $user .…
josepmra
  • 617
  • 9
  • 25
2
votes
2 answers

Zend Framework: Zend_translate and routing related issue

I have implemented Zend_Navigation, Zend_Translate in my application. The routing is setup in Bootstrap.php like below. $fc = Zend_Controller_Front::getInstance(); $zl=new Zend_Locale(); Zend_Registry::set('Zend_Locale',$zl); …
Dan
  • 78
  • 8
2
votes
0 answers

Zend Translate - Locale not working

I started working on a multilangual Zend Framework application and I've been stucked on something I hate: The locale is not working like expected. There's the .ini config: ; Locale resources.locale.default = "fr" resources.locale.force =…
Frederick Marcoux
  • 2,195
  • 1
  • 26
  • 57
2
votes
2 answers

zend translate and smarty

I am using ZendTranslate(csv adapter) with Smarty in my project. I use ZendTranslate as standalone not all Zend because it seems very nice and easy to use. But I have a problem. I cant find out best way to grab all content and send to Smarty. My…
consigliere
  • 73
  • 3
  • 11
2
votes
2 answers

Zend translate tries including '.php' and causing a fatal error

I am receiving a strange fatal error with the Zend framework when trying to use the Translate class, it appears to try to load an empty file name (.php) which is ending in a fatal error. Below is the stack trace [error] [client 79.160.197.135] PHP…
Clorith
  • 459
  • 1
  • 6
  • 16
2
votes
1 answer

Zend_Translate Strategy for a huge grown web site

since I'm thinking in a good way to handle translation did part of a implementation and going toward a concept that still don't know if it's good and I would like to share it and get the pros and cons of it with someone that think it's a good point…
Ruben Trancoso
  • 1,444
  • 5
  • 27
  • 55
2
votes
1 answer

Zend_Form setAttrib title not translating with Zend_Translate

When setting the title attribute in Zend_Form, this is not being translated. (Label & errors are translated fine) // form file $email = new Zend_Form_Element_Text('username'); $email->setLabel('auth.form.login.username') ->setRequired(true) …
Eddie Jaoude
  • 1,698
  • 15
  • 23
1
vote
1 answer

Zend Framework 2: how to inject configured Zend\Translator\Adapter\Gettext into Zend\View\Helper\Translator

I have a problem with that component. My configuration in Application/config/module.config.php in di->instance section: 'alias' => array ( 'translateAdapter' => 'Zend\Translator\Adapter\Gettext', 'viewHelper' =>…
Alex Oleshkevich
  • 184
  • 2
  • 12
1
vote
2 answers

Zend Translate custom language

Depending on the user role, I need to show different texts in my Zend project. For normal users I'm using the "en" language. For new users I want something like "en_new". However, the language "en_new" always reverts to just "en". I'm using the…
1
vote
1 answer

Zend framework - duplication in translated url

I have these URLs cz/kontroler/akce en/controller/action Is used transatable route and works it like charm. But problem is, that when you will write cz/controller/akce it works as well. In generally when you…
tomasr
  • 485
  • 1
  • 8
  • 24
1 2
3
10 11