Translation : Fix bug preventing to see error message

This commit is contained in:
gmorel
2013-11-27 20:11:54 +01:00
parent 59932078fc
commit 612bd1adae

View File

@@ -121,19 +121,19 @@ class TemplateHelper
} }
/** /**
* Récursively examine files in a directory tree, and extract translatable strings. * Recursively examine files in a directory tree, and extract translatable strings.
* *
* Returns an array of translatable strings, each item having with the following structure: * Returns an array of translatable strings, each item having with the following structure:
* 'files' an arfray of file names in which the string appears, * 'files' an array of file names in which the string appears,
* 'text' the translatable text * 'text' the translatable text
* 'translation' => the text translation, or an empty string if none available. * 'translation' => the text translation, or an empty string if none available.
* 'dollar' => true if the translatable text contains a $ * 'dollar' => true if the translatable text contains a $
* *
* @param string $directory the path to the directory to examine * @param string $directory the path to the directory to examine
* @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE * @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE
* @param Thelia\Core\Translation\Translator $translator the current translator * @param \Thelia\Core\Translation\Translator $translator the current translator
* @param string $currentLocale the current locale * @param string $currentLocale the current locale
* @param array $strings the liste of strings * @param array $strings the list of strings
* @throws \InvalidArgumentException if $walkMode contains an invalid value * @throws \InvalidArgumentException if $walkMode contains an invalid value
* @return number the total number of translatable texts * @return number the total number of translatable texts
*/ */
@@ -248,15 +248,15 @@ class TemplateHelper
fwrite($fp, ");\n"); fwrite($fp, ");\n");
@fclose($fh); @fclose($fp);
} }
else else
{ {
throw new \RuntimeException( throw new \RuntimeException(
$this->getTranslator()->trans( Translator::getInstance()->trans(
"Failed to open translation file %file. Please be sure that this file is writable by your Web server", 'Failed to open translation file %file. Please be sure that this file is writable by your Web server',
array('%file' => $file) array('%file' => $file)
) )
); );
} }
} }