0

I have following Route setup:

routeXY.type = "Zend_Controller_Router_Route"
routeXY.route = "@XY"
routeXY.defaults.module = "default"
routeXY.defaults.controller = "index"
routeXY.defaults.action = "actionXY"

Then also pair in my translation array (XY -> YZ).

If I try to access translated URL segment like:

localhost/YZ

I'm getting correct action "actionXY".

However, whe I'm trying to assembly URL by using view url helper, it's always building URL untranslated. Calling:

<?= $this->url(Array('@locale' => Zend_Registry::get('Zend_Locale')), 'routeXY', true);?> 

With locale set to get "YZ", getting:

localhost/XY

How to enforce translation during assembly ?

Ivan
  • 315
  • 1
  • 3
  • 16

1 Answers1

1

Finally, my understanding was a bit wrong. I need to explicitly setup in bootstrap default language, from which route should be translated. This language must be 'FROM' language, not target laguage:

Zend_Controller_Router_Route::setDefaultLocale('any_lang');

String in this language is used as default translate key.

Ivan
  • 315
  • 1
  • 3
  • 16