Abhoryo / APYJsFormValidationBundle

This bundle performs validations of a form in javascript. (i18n compatible and several javascript frameworks supported)
92 stars 23 forks source link

[Translation] Make placeholder prefix and suffix configurable #41

Open hruben opened 11 years ago

hruben commented 11 years ago

JSFV uses the same error messages as the Symfony constraints. So it appears only natural to me to use the same placeholder marks. However, jsfv.getComputeMessage() always sets these marks to '{{ ' and ' }}'. It would save a lot of effort to have some easy way of changing this back to the ExposeTranslationBundle's default value of '%'. One option is to make the placeholder prefix and suffix a parameter in parameters.yml. Another option is to add a block around jsfv.getComputeMessage() so that it can be easily overridden.

recipe commented 11 years ago

@Abhoryo why do we use braces? I agree with @hruben we need to use "%" by default.

Abhoryo commented 11 years ago

Braces were the ExposeTranslationBundle's default value.

hruben commented 11 years ago

In 0.3.x-dev, it's '%', see vendor/willdurand/expose-translation-bundle/Bazinga/ExposeTranslationBundle/Resources/public/js/translator.js line 335. And even if it was the default value, I would like to be able to change it. The intention is to use the same translations for PHP and JS generated messages, so '%' surely makes sense.

Abhoryo commented 11 years ago

You can change the default for the moment.