The application working in 2 countries so far (Spain, UK), with plans for expanding to others.
During the development few nice components has been written:
Multilanguage Url Manager - allows defining the custom urls per lanugage for the same path and defining (I haven’t found any working component with a functionality I needed)
Thanks for comment. The Multilanguage Url Component is not perfect, but meets my needs, what I did is I overriden the CUrlManager and added the array with translations to it. The translations are configured in the config file this way:
Then I overriden methods createUrl and parseUrl and before calling parent method I check if some translation from the translations array matches the URL. If so, I replace it, if not I just continue.
It’s the basic scenario, I added also the patterns for the parametrized urls, so it for example can override:
/product/list/year/2013
to
/producto/ano-2013
This works the same as the translations, but I have two arrays of regex patterns - one for creating the URLs second for parsing the urls.
For now I use one config per language, so it’s simple, but if you want to use one config for all languages, you can extend the arrays to be 3 dimensional with the language on the first dimension.
Thanks for the explanation. I had a quick look at the CUrlManager and overriding the createUrl and parseUrl methods seems doable.
So for the parseUrl you first check and process the static translations. Then, if no match, you also check for a regex match for paramterized URLs, and finally pass the result to the inherited method. [size=2]Is that how it works?[/size]