zendframework / zend-router

Standalone routing implementation for HTTP and console requests
BSD 3-Clause "New" or "Revised" License
32 stars 20 forks source link

Translation issue with Router #24

Open bruno911 opened 7 years ago

bruno911 commented 7 years ago

Based on the idea of this:

<?= $this->translate(sprintf('My name is %s', 'Bruno')) ?>

I wanted to create a Url segment, for example:

'/{:param1-somelabelhere-:param2}'

Now, let say using array translation I do like this:

<?php
return array(
    ':param1-somelabelhere-:param2' => ':param1-somelabelisnowtranslated-:param2',
);

The issue comes here, when I am in the view, if I do:

Url: <?= $this->url('myroutename', array('param1'=>11, 'param2'=>22)) ?>

It renders as:

Url: /:param1-somelabelisnowtranslated-:param2

Instead of expecting behaviour:

Url: /11-somelabelisnowtranslated-22

Any ideas? It seems to be like a bug. For example in Spanish and English the position of the words is usually different, so it wouldn't make any sense for me to translate something like: english-schools-new-york as ingles-escuelas-nueva-york, that phrase should be translated as escuelas-ingles-nueva-york.

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-router; a new issue has been opened at https://github.com/laminas/laminas-router/issues/8.