I'm fighting with ZF2 to force one specific validation messages translation for any incoming browser locale.
So I just want ZF2 to always use it's own provided translations of error messages to russian, this file:
\vendor\zendframework\zendframework\resources\languages\ru\Zend_Validate.php
I've tried creating Translator and setting it as Default at onBootstrap
:
$translator = new \Zend\Mvc\I18n\Translator();
$translator->addTranslationFile(
'phpArray',
'vendor/zendframework/zendframework/resources/languages/ru/Zend_Validate.php',
'default',
'ru_RU'
);
AbstractValidator::setDefaultTranslator($translator);
As this topic suggests - Zend Framework 2 - Translate Standard Form Validation and Error messages but no effect!
I've tried forcing Locale at module config with the same no results:
'translator' => array(
'locale' => 'ru_RU'
),
I'm not sure, maybe something is wrong with translation file URL? Cause when I try Z-Dumb the translator, it claims having 1 file registered by 0 messages.
Anyway, what is the easiest way to force default validator translation to always be russian?
Big thanks!