-
-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validator text #36
Comments
I know, this is a weird one. I haven't been able to get it right, even though I think the code is how it should be. See also this pull-request, where we tried to fix it (unsuccessfully): https://github.com/bobdenotter/bolt/pull/22 |
Was looking into this one during lunch. Found these resources:
Also tried $app['translator']->addLoader('xlf', new \Symfony\Component\Translation\Loader\XliffFileLoader()); $app['translator']->addResource('xlf', __DIR__ . '/../../../../vendor/symfony/validator/Symfony/Component/Validator/Resources/translations/validators.' . $app['locale'] . '.xlf', $app['locale'], 'validators'); Also unsuccessful. However, it looks like the validation translations aren't loaded or so.. |
This is an odd issue. I think it's a bug, but we can't be sure. If i can find some time, i'll try to set up a basic test case, so we can file a bug on the silex repo. (Unless you have other ideas, that is) |
I'll give it another try, unless you already have your test case..? |
No, I haven't spent any time on this yet. |
I use the following fragment in my bootstrap of another Silex application: $app->register(new Silex\Provider\FormServiceProvider());
$app->register(new Silex\Provider\ValidatorServiceProvider());
$app->register(new Silex\Provider\TranslationServiceProvider(), array(
'locale' => 'nl',
'translator.messages' => array()
));
$app['translator']->addLoader('xlf', new Symfony\Component\Translation\Loader\XliffFileLoader());
$app['translator']->addResource('xlf', __DIR__ . '/../vendor/symfony/validator/Symfony/Component/Validator/Resources/translations/validators.nl.xlf', 'nl', 'validators'); It translates the validation messages in Dutch in that application. All messages stay in English, no matter if I define $app['locale'] = 'nl' as well as the above fragment in the bootstrap as well as putting my browser to use the Dutch locale. |
So, you're saying you don't know either why it's not working as it should? ;-) I guess i'll just have to strip it down to a bare bones example, so we can either pinpoint where we did it wrong, or it might be a bug in silex. |
Jup and the only thing that could be done is indeed strip it down and check by trial-and-error what is causing this to happen. I got some time to spend again, so I can try and start stripping it down (unless you have already started that is..?) |
No, i haven't looked into it yet. I've been working on fleshing out On Thu, Jan 3, 2013 at 3:58 PM, Patrick van Kouteren <
Bob den Otter - bob@twokings.nl - 070-3457628 - www.twokings.nl |
Okay, I have to check with the code where it works when I get home, but I got a bare setup which works. Unfortunately not in the Bolt-way just yet. |
I got this one covered. Will look at issue #79 after I fixed this one. Looks kind of related. |
Got this one fixed. However, there are multiple ways to do this each with their own elegance, so I'd like some input on the pull request :) |
Closed by the merge |
When trying to register a (first) user 'Admin' with password 'admin', the password is too short (because of the minimum length of 6 characters). The error messages I get aren't nice:
snippet
8<---------------------------------
Password
This value is too short. It should have {{ limit }} characters or more.
This value is too short. It should have 6 characters or more.
Password (confirmation)
This value is too short. It should have {{ limit }} characters or more.
8<----------------------------------
end of snippet
The text was updated successfully, but these errors were encountered: