Commit 57a36c4c authored by arnaudbey's avatar arnaudbey
Browse files

add msg when no transl found

parent 8797b285
......@@ -4,6 +4,13 @@ namespace Innova\WiktionaryBundle\Manager;
class WiktionaryManager
{
protected $translator;
public function __construct($translator)
{
$this->translator = $translator;
}
protected $patterns = [
'fr' => [
'definitions' => '/<span[\s\S]+?id="fr"[\s\S]*?(<ol>[\s\S]*?<\/ol>)/',
......@@ -30,7 +37,7 @@ class WiktionaryManager
}
}
return;
return $this->translator->trans("nowiktionarydef", ['%word%'=>$form, '%language%'=>$language]);
}
public function getRandomDefinition($form, $language)
......
services:
innovalangues_wiktionary:
class: Innova\WiktionaryBundle\Manager\WiktionaryManager
arguments: ["@translator"]
twig.extension.wiktionary:
class: Innova\WiktionaryBundle\Twig\WiktionaryExtension
......
nowiktionarydef: No definition found on wiktionary for %word% (%language%).
nowiktionarydef: Pas de définition trouvée sur wiktionary pour %word% (%language%).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment