translation of action in URL

Hello,

I would like to ask you how to translate <action> ("prihlasit" in czech which should refers to actionLogin in english) in URL to some language but keep original action name in english ("actionLogin"), I hope you understand my question, thanks.

Maybe I have not correctly understood you… If you want to implement redirect from "/prihlasit" to "actionLogin" you should add to your config url rule like this:




'urlManager' => [

            'class' => 'yii\web\UrlManager',

            'rules' => array(

                'prihlasit' => 'login'

               ...

            )



I think that you understand me, but this solution does not work for me.

I have module Login with custom config /backend/modules/Login/config/main.php:


<?php

return [

    'components' => [

        'urlManager' => [

            'class' => 'yii\web\UrlManager',

            'rules' => [

                'prihlasit' => 'login',

            ]

        ]

    ]

];

/backend/modules/Login/config/main.php


<?php


namespace backend\modules\Login;


class Login extends \yii\base\Module

{

    public $controllerNamespace = 'backend\modules\Login\controllers';


    public function init()

    {

        parent::init();

        \Yii::configure($this, require(__DIR__ . '/config/main.php'));

    }

}

in controller I have actionLogin.

"prihlaseni" is module name.

When I go to /backend/prihlaseni/prihlasit it throws InvalidRouteException.

Sorry!

It works, I had parent rule which rewrite this rule :-/

Thanks for your help