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
4
votes
3 answers

How to use translate helper in controllers in zend framework 2

Is there any possible way to translate strings in controllers instead of view? Right now, in my controllers, if I pass strings like : public function indexAction() { return array('message' => 'example message'); } It will be translated in…
Sanju
  • 401
  • 3
  • 7
  • 15
4
votes
5 answers

Zend Framework 2 - Translate Standard Form Validation and Error messages

I'm writing a complete German application and therefore need to set basically everything to German. My question: What is the best and easiest way to set for example the form validation to German? I found this page but couldn't figure out how to get…
Ron
  • 22,128
  • 31
  • 108
  • 206
3
votes
4 answers

zend_translate and zend_locale

Please provide me the folder strusture and code for simple small application for zend_translate and zend_locale. So that I will have some idea about it. I referred framework.zend but could not understand what are the things which I should mention in…
vrushali
  • 59
  • 1
  • 6
3
votes
2 answers

ZF language and translate

I need a good working example with language and translate within ZF. My need is folowing: If no lang is selected, 'en' should be default. (On the top op the page there is a lang selector.) The lang should be stored in the session. The translation…
cwhisperer
  • 1,478
  • 1
  • 32
  • 63
3
votes
1 answer

How do you organize gettext translation files which REGIONALISED?

My application is i18n but with region difference, that's mean, I'll need to have such translations: ch_DE fr_FR cn_HK ru_RU etc... In the Zend_Translate documentation it's said that you can use the following structure : /languages /en …
JohnT
  • 967
  • 2
  • 16
  • 30
3
votes
3 answers

How to translate messages of a custom validator in Zend Framework?

I created a custom validator by extending Zend_Validate_Abstract to validate a CAPTCHA input regarding Zend_Captcha: class My_Validate_Captcha extends Zend_Validate_Abstract { const CAPTCHA = 'captcha'; protected $_messageTemplates = array( …
3
votes
1 answer

Multilingual Site in Zend Framework

i am working on a site to include Multilingual Support. I can translate strings using Zend_Translate but what about the content?? For example do i have to add multiple records for same product's for each language? Or is there any other way? I am new…
Imran Naqvi
  • 2,202
  • 5
  • 26
  • 53
3
votes
2 answers

Dynamically change default route parameters in zend framework 2?

I need to change my language application dynamically. I have the folowing route configuration: 'route' => '/[:lang[/:controller[/:action[/:id]]]][[/page/:page]]', 'defaults' => array( 'lang' => 'en', ), Is it possible to change the…
blackbishop
  • 30,945
  • 11
  • 55
  • 76
3
votes
1 answer

Translation of database with poedit and zend translate

Poedit does not automatically recognise the content of a table in a database. What is the best way to get the content of a table recognized by poedit for its translation in zend. I would like it to be done automatically....do I have to create an xml…
3
votes
2 answers

Zend Framework 2 translate form errors doesnt work

I spent all night trying to figure out why this code doesn't work $inputFilter = new InputFilter(); $factory = new InputFactory(); $translator = new \Zend\I18n\Translator\Translator(); //Copy of file found in…
David Noreña
  • 3,951
  • 1
  • 28
  • 43
2
votes
2 answers

Handle punctuation using Zend_Translate

Currently, I'm trying to apply Zend_Translate to the project I'm working on. Regular text works perfectly fine, but I ran into a problem with the translation of forms. The translation adapter is registered in Zend_Registry, using Zend_Translate as…
Lex
  • 293
  • 1
  • 5
  • 15
2
votes
2 answers

Zend Translate - Set Locale per User

I'm developing a multi-lingual site. I've put a Zend_Translate object in the Zend_Registry and I use it to translate all static texts to the selected locale. My question is how do I change the locale when the user chooses another language? If I get…
Ran
  • 4,117
  • 4
  • 44
  • 70
2
votes
1 answer

Implementing Zend_Locale and Zend_Translate with modules

I've searched the internet for a good solution to integrating Zend_Locale and Zend_Translate into a modular structure. Here's the endpath I want: http://url/:lang/:module/:controller/:action http://url/:lang/:controller/:action…
somejkuser
  • 8,856
  • 20
  • 64
  • 130
2
votes
1 answer

Automatic translation of multioptions in Zend_Form breaks sortorder

I have the following issue. I create a Zend_Select element and add multioptions in an array. Zend automatically translates the options, after which my multioptions are sorted incorrectly. Right now, my only option seems to be: $element =…
eelco
  • 218
  • 1
  • 9
2
votes
1 answer

Translating route segments with ZF's gettext adapter

I want to try out the route translations in Zend Framework, but I'm using the gettext adapter and the most tutorials have PHP translate adapter, so I'm having problems to make it work. In the main Bootstrap.php I have the method in which I set the…
nevvermind
  • 3,302
  • 1
  • 36
  • 45
1
2
3
10 11