title: Zend Framework 2 - Translate Standard Form Validation and Error messages
body: <p>I'm writing a complete German application and therefore need to set basically everything to German.</p>
  
  <p>My question: What is the best and easiest way to set for example the form validation to German?</p>
  
  <p>I found <a href="http://framework.zend.com/manual/1.12/en/zend.form.i18n.html" rel="nofollow">this page</a> but couldn't figure out how to get this code working:</p>
  
  <pre><code>Zend_Validate_Abstract::setDefaultTranslator($translate);
  </code></pre>
  
  <p>Could anyone give me some advice how to use this?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Thanks to @Gordon I put the following into my Application/Module.php:</p>
  
  <pre><code>use Zend\I18n\Translator\Translator;
  use Zend\Validator\AbstractValidator;
  
  class Module
  {
  public function onBootstrap(MvcEvent $e)
  {
      ...
  
       $translator = new Translator();
       $translator-&gt;addTranslationFile(
        'phpArray',
        'resources/languages/de.php',
        'default',
        'de_DE'
       );
           AbstractValidator::setDefaultTranslator($translator);
      ...
  }
  </code></pre>
  
  <p><strong>Edit 2:</strong>
  Alright, this is odd. When I set <code>de_DE</code> I get the message that the de.php file couldn't be opened - which is true because "de" is a folder containing two other PHP files. </p>
  
  <blockquote>
    <p>Could not open file resources/languages/de.php for reading</p>
  </blockquote>
  
  <p>Altering the path to the folder or to any existing file within it doesnt help...</p>
  
  <p>When I change the "de_DE" to "de" or "de_de" then nothing happens. No error and English validation errors. Any clues?</p>