<?php
declare(strict_types=1);
/**
* @author Mehrez Labidi
* @Description service pour avoir la locale de traduction, EN, FR .. (Langues .. )
*/
namespace App\Helper;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
class LocaleProvider {
/**
* @var type
*/
private $session;
/**
* @param SessionInterface $session
*/
public function __construct(SessionInterface $session) {
$this->session = $session;
}
/**
* @return string
*/
public function getLocale(): string {
return $this->session->get('_locale') ? $this->session->get('_locale') : "fr";
}
}