Giter Site home page Giter Site logo

Validator text about bolt HOT 13 CLOSED

pvankouteren avatar pvankouteren commented on May 22, 2024
Validator text

from bolt.

Comments (13)

bobdenotter avatar bobdenotter commented on May 22, 2024

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

from bolt.

pvankouteren avatar pvankouteren commented on May 22, 2024

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..

from bolt.

bobdenotter avatar bobdenotter commented on May 22, 2024

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)

from bolt.

pvankouteren avatar pvankouteren commented on May 22, 2024

I'll give it another try, unless you already have your test case..?

from bolt.

bobdenotter avatar bobdenotter commented on May 22, 2024

No, I haven't spent any time on this yet.

from bolt.

pvankouteren avatar pvankouteren commented on May 22, 2024

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.
When applying the same to Bolt, the translations are still in English.

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.

from bolt.

bobdenotter avatar bobdenotter commented on May 22, 2024

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.

from bolt.

pvankouteren avatar pvankouteren commented on May 22, 2024

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..?)

from bolt.

bobdenotter avatar bobdenotter commented on May 22, 2024

No, i haven't looked into it yet. I've been working on fleshing out
Taxonomies and Relationships, mostly.

On Thu, Jan 3, 2013 at 3:58 PM, Patrick van Kouteren <
[email protected]> wrote:

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..?)


Reply to this email directly or view it on GitHubhttps://github.com/bobdenotter/bolt/issues/36#issuecomment-11846227.

Bob den Otter - [email protected] - 070-3457628 - www.twokings.nl

from bolt.

pvankouteren avatar pvankouteren commented on May 22, 2024

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.

from bolt.

pvankouteren avatar pvankouteren commented on May 22, 2024

I got this one covered. Will look at issue #79 after I fixed this one. Looks kind of related.

from bolt.

pvankouteren avatar pvankouteren commented on May 22, 2024

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 :)

from bolt.

pvankouteren avatar pvankouteren commented on May 22, 2024

Closed by the merge

from bolt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.