kevinchappell / formBuilder

A jQuery plugin for drag and drop form creation
https://formbuilder.online
MIT License
2.63k stars 1.4k forks source link

[i18n][override] - "Other" label #1163

Closed Wujek280 closed 1 year ago

Wujek280 commented 3 years ago

Description:

I have trouble customising language in UI. Changes (as override) in i18n setting does not appear in rendered form.

Steps to Reproduce


- Observe, that label for "Other" remain the same as before overriding in option

### Expected Behavior
Should result in different (specified) label text for "Other" option in checkbox/radio 

### Actual Behavior
Other label is rendered as "Other" despite change in lang settings

### Environment Details:
 - formBuilder Version: 3.6.1
 - Browser: Chrome/Chromium
 - OS: macOS

### Possible Resolution 

What I have found is that there is

https://github.com/kevinchappell/formBuilder/blob/902206505760b8af8417f479a4ddcdc641c46b10/src/js/control/select.js#L129

with hard-coded "Other" string instead of referece to i18n.

If that's the case I would be more than happy to hear guidance on how to fix this and submit pull request.
lucasnetau commented 1 year ago

You can access mi18n within the control plugin.

Replacing 'Other' with control.mi18n('other') should fix your issue

lucasnetau commented 1 year ago

Please try PR #1385, FormRender will correctly use the value from override or the language file