diff --git a/Dockerfile b/Dockerfile index 618c27b..50fc755 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM ubuntu:14.04 -MAINTAINER Frederic Guillot RUN apt-get update && \ apt-get install -y apache2 php5 php5-sqlite php5-curl && \ diff --git a/app/controllers/feed.php b/app/controllers/feed.php index 86494fc..703a188 100644 --- a/app/controllers/feed.php +++ b/app/controllers/feed.php @@ -147,7 +147,7 @@ Router\get_action('add', function () { ))); }); -// Add a feed with the form or directly from the url, it can be used by a bookmarklet by example +// Add a feed with the form or directly from the url, it can be used by a bookmarklet for example Router\action('subscribe', function () { if (Request\is_post()) { $values = Request\values(); diff --git a/app/core/translator.php b/app/core/translator.php index 8e48d36..ebcb383 100644 --- a/app/core/translator.php +++ b/app/core/translator.php @@ -2,7 +2,9 @@ namespace Translator; -const PATH = '../locales/'; +use DirectoryIterator; + +const PATH = '/../locales/'; function translate($identifier) { @@ -15,7 +17,7 @@ function translate($identifier) $arg = htmlspecialchars($arg, ENT_QUOTES, 'UTF-8', false); } - return \call_user_func_array( + return call_user_func_array( 'sprintf', $args ); @@ -115,11 +117,11 @@ function load($language) { setlocale(LC_TIME, $language.'.UTF-8'); - $path = PATH.$language; + $path = __DIR__.PATH.$language; $locales = array(); if (is_dir($path)) { - $dir = new \DirectoryIterator($path); + $dir = new DirectoryIterator($path); foreach ($dir as $fileinfo) { if (strpos($fileinfo->getFilename(), '.php') !== false) {