[ask] Yii multilanguage url

dear yii’ers

i want to ask about translation in url

i have a url

english version


where action are index|view|update|delete

indonesia url translation


where action are index|lihat|mutakhirkan|hapus

url pattern http://example.com/<lang>/<controller>/<action>

how to make translation pair of that url? On the tutorial only describe switch language without change into localisation controller or action

Hello Xent,

Have you found any solution to this? I’m searching for a solution to this for a while now and couldn’t come up with anything. The only way I can see to do this is to define every link in UrlManager’s rule option.

You need to write your own custom URL manager that handles the language code and translated controller names.

You can either hardcode all this or use database queries to check if language codes and controller names are valid.