protected function setUp() { Locale::setDefault('en'); Locale::setDefaultFallback('en'); }
$baseDir = dirname(__DIR__) . '/data'; //$txtDir = $baseDir.'/txt'; $jsonDir = $baseDir; //$phpDir = $baseDir.'/'.Intl::PHP; //$resDir = $baseDir.'/'.Intl::RB_V2; $targetDirs = array($jsonDir); $workingDirs = array($jsonDir); //$config->addBundleWriter($txtDir, new TextBundleWriter()); $config->addBundleWriter($jsonDir, new JsonBundleWriter()); echo "Starting resource bundle compilation. This may take a while...\n"; $filesystem->remove($workingDirs); foreach ($workingDirs as $targetDir) { $filesystem->mkdir(array($targetDir . '/' . Intl::CURRENCY_DIR, $targetDir . '/' . Intl::LANGUAGE_DIR, $targetDir . '/' . Intl::LOCALE_DIR, $targetDir . '/' . Intl::REGION_DIR, $targetDir . '/' . Intl::SCRIPT_DIR)); } // We don't want to use fallback to English during generation Locale::setDefaultFallback(null); echo "Generating language data...\n"; $generator = new LanguageDataGenerator($compiler, Intl::LANGUAGE_DIR); $generator->generateData($config); //echo "Compiling...\n"; // //$compiler->compile($txtDir.'/'.Intl::LANGUAGE_DIR, $resDir.'/'.Intl::LANGUAGE_DIR); echo "Generating script data...\n"; $generator = new ScriptDataGenerator($compiler, Intl::SCRIPT_DIR); $generator->generateData($config); //echo "Compiling...\n"; // //$compiler->compile($txtDir.'/'.Intl::SCRIPT_DIR, $resDir.'/'.Intl::SCRIPT_DIR); echo "Generating region data...\n"; $generator = new RegionDataGenerator($compiler, Intl::REGION_DIR); $generator->generateData($config);
public function connexion_utilisateurAction() { $request = $this->getRequest(); $session = $request->getSession(); // get the login error if there is one if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) { $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR); } else { $error = $session->get(SecurityContext::AUTHENTICATION_ERROR); $session->remove(SecurityContext::AUTHENTICATION_ERROR); } //Création des variables de session //Local pour la traduction et récupération des fichier XLLIF //$this->get('session')->set('_locale', 'fr'); Locale::setDefaultFallback('fr'); return $this->render('ROUtilisateurBundle:utilisateur:connexion_utilisateur.html.twig', array('error' => $error)); }