Commit 8e7c0a4b authored by Sasa Stamenkovic's avatar Sasa Stamenkovic

Applied fixes requested by igorw.

parent d7df7eb8
Translating Validation Messages
===============================
When working with Symfony2 forms, a common task would be to show localized validation messages.
When working with Symfony2 validator, a common task would be to show localized validation messages.
In order to do that, you will need to register translator and point to translated resources:
......@@ -12,7 +12,9 @@ In order to do that, you will need to register translator and point to translate
'translation.class_path' => __DIR__ . '/vendor/symfony/src',
'translator.messages' => array()
));
$app->before(function () use ($app) {
$app['translator']->addLoader('xlf', new Symfony\Component\Translation\Loader\XliffFileLoader());
$app['translator']->addResource('xlf', __DIR__ . '/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.sr_Latn.xlf', 'sr_Latn', 'validators');
});
And that's all you need to load translations from Symfony2 ``xlf`` files.
\ No newline at end of file
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