[Koha-bugs] [Bug 10848] Allow configuration of mandatory/ required fields on the suggestion form in OPAC

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Aug 9 07:20:14 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10848

--- Comment #46 from Jacek Ablewicz <abl at biblos.pk.edu.pl> ---
(In reply to Katrin Fischer from comment #45)
> Hi Jacek, how do you add to the po files?
> You should not need to change anything manually there. For a git
> installation try:
> - switch to misc/translator in your koha directory
> - perl translate update <langcode>
> - perl translate install <langcode>
> 
> The first updates the templates the second installs them from the po file
> for testing.

That's how I've been trying to test it. Well, manually adding a few odd extra
strings in the .po file and 'translate install' without 'translate update' is
not below my dignity too ;) - I know it's not a proper way, but it should work
just fine for testing purposes (usually does in similar circumstances).

Problem is that messages embedded in the .js file ("This field is required",
"Please enter a valid email address", ...) are not picked up for translation.
This is most likely normal, I just wasn't aware of that.

Looks like there are several ways to fix this issue, either globally for
OPAC/bootstrap - like it was done for intranet/prog in Bug 6209, or locally 
in the given OPAC templates, e.g. using a combination of 

    jQuery.extend(jQuery.validator.messages, {
        required: _("This field is required."),
        email: _("Please enter a valid email address."),
        ...

for the "regular" mandatory fields, and/or

    jQuery.validator.addMethod("year", function(value, element) {
        ...
    }, _("Please enter a year in the valid format (YYYY, YY--)"));


for a field with the pattern. I guess preferably it should be fixed globally
for the OPAC (opac-memberentry.tt is affected by this too), but I'm a bit out
of my depth here - I'll better open a separate bug report for that part.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list