Arcanedev\Localization\Contracts\RouteTranslatorInterface::trans PHP Method

trans() public method

Translate routes and save them to the translated routes array (used in the localize route filter).
public trans ( string $route, string | null $locale = null ) : string
$route string
$locale string | null
return string
    public function trans($route, $locale = null);

Usage Example

Example #1
0
 /**
  * Translate routes and save them to the translated routes array (used in the localize route filter).
  *
  * @param  string  $routeName
  *
  * @return string
  */
 public function transRoute($routeName)
 {
     return $this->routeTranslator->trans($routeName);
 }