0

i'm searching for a solution to solve the following problem in zf2:

i have a list of destinations, and i want a search-formular on my page with auto-completion. also the list is used to translate parts of my web-page, so i will use zend_translate to do this.

it it possible to "reverse-search" the list of translations with zend_translate? Example:

$translate->getKeysByExpression('*ger*');

result:

array (
    array ( 'key' => '__germany__', 'name' => 'germany'),
    array ( 'key' => '__trn_landwithger__', 'name' => 'landwithger'
)

it is not the biggest problem if i have to load the complete list of translations, it is not that much.

or is it better to use mongodb as backend for zend_translate, and use direct queries to find the completion-candidates?

RomanKonz
  • 1,027
  • 1
  • 8
  • 15
  • zf2, i added it to the description, thanks! – RomanKonz Sep 26 '12 at 12:24
  • The Zend\i18n\Translator\Translator appears to create a cache of messages when loadMessages() is called. The cache seems to be separated by locale, so maybe using one of the array comparison functions would allow you to do this. – DrBeza Sep 28 '12 at 22:16

0 Answers0