coderifous / jquery-localize

a jQuery plugin that makes it easy to internationalize your web site.
465 stars 142 forks source link

Script does not localize optgroup tags #2

Closed culbert closed 13 years ago

culbert commented 15 years ago

My UI uses option groups in drop downs and I would like to be able to localize the labels.

I could do this with a custom callback but I propose that this is a reasonable thing for the default callback to handle. Handling the optgroup would require adding (essentially...) :

    tag = elem.attr('tagName');

           ....

    else if (tag === 'OPTGROUP') {
        elem.attr('label', value);
    }

I think this is a better option than reimplementing the default callback as a custom cb (with the simple addition). The other option would be to scan for the optgroups in a custom cb and "fallthrough" to the default but, this would iterate the wrappedset twice which would not be good.

coderifous commented 13 years ago

Added support for localizing optgroup tags. [Closed by 2d4deb458116424f53703c1ba0b3c00066010673]