diff --git a/app/bootstrap.php b/app/bootstrap.php index 5838927..f886907 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -20,7 +20,7 @@ return call_user_func(function () { $files = array(); foreach (new DirectoryIterator(__FILE__ . '.d') as $file) { - if (!$file->isDot() && $file->isFile()) { + if (!$file->isDot() && $file->isFile() && $file->getBasename()[0] !== '.') { $files[] = $file->getPathname(); } } diff --git a/app/bootstrap.php.d/20-twig.php b/app/bootstrap.php.d/20-twig.php index df3ce3f..4f5a342 100644 --- a/app/bootstrap.php.d/20-twig.php +++ b/app/bootstrap.php.d/20-twig.php @@ -7,7 +7,7 @@ $app->register(new TwigServiceProvider(), array( )); $app->extend('twig', function ($twig, $app) { - $twig->addGlobal('web_path', '/'); + $twig->addGlobal('web_path', $app['request']->getBaseUrl().'/'); return $twig; }); diff --git a/app/bootstrap.php.d/30-trans.php b/app/bootstrap.php.d/30-trans.php index 43859e1..7dc23b8 100644 --- a/app/bootstrap.php.d/30-trans.php +++ b/app/bootstrap.php.d/30-trans.php @@ -26,13 +26,13 @@ $app['translator'] = $app->extend('translator', function ($translator, $app) { return $translator; }); -$app['routes'] = $app->extend('routes', function ($routes, $app) { +$app['routes'] = $app->share($app->extend('routes', function ($routes, $app) { $routes->addPrefix('/{_locale}'); $routes->addDefaults(array('_locale' => $app['locale_fallbacks'][0])); $routes->addRequirements(array('_locale' => implode('|', $app['locales']))); return $routes; -}); +})); /** * Redirect home on right locale page, regarding of request accept locale or diff --git a/app/bootstrap.php.d/50-git.php b/app/bootstrap.php.d/50-git.php index d460d1f..80bb64d 100644 --- a/app/bootstrap.php.d/50-git.php +++ b/app/bootstrap.php.d/50-git.php @@ -3,7 +3,5 @@ use GitWrapper\GitWrapper; $app['git'] = function ($app) { - echo "ok"; - return new GitWrapper(); }; diff --git a/app/locales/fr.yml b/app/locales/fr.yml index e69de29..b1411d6 100644 --- a/app/locales/fr.yml +++ b/app/locales/fr.yml @@ -0,0 +1,36 @@ +app: + title_prefix: '#!GIST - ' + + menu: + home: + title: 'Accueil' + about: + title: 'À propos' + +form: + error: + not_blank: 'Vous devez saisir cette donnée.' + title: + placeholder: 'Titre' + cipher: + alert: 'En activant le chiffrement, le fork deviendra impossible.' + label: 'Chiffrer : %value%' + choice: + yes: 'Oui' + no: 'No' + type: + label: 'Langage : %value%' + choice: + xml: 'HTML/XML' + css: 'CSS' + js: 'JAVASCRIPT' + php: 'PHP' + sql: 'SQL' + yaml: 'YAML' + perl: 'PERL' + c: 'C/C++' + asp: 'ASP' + python: 'PYTHON' + bash: 'BASH' + as: 'ACTION SCRIPT' + text: 'TEXTE' diff --git a/composer.json b/composer.json index 77c01ba..c63fe54 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require": { "geshi/geshi": "dev-master", - "silex/silex": "dev-master", + "silex/silex": "1.3.x-dev", "symfony/yaml": "~2.6", "symfony/twig-bridge": "~2.6", "symfony/translation": "dev-master",