Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels for fields and replaceFields options do not use localized strings #1578

Closed
mtthwprtchrd opened this issue Jul 3, 2024 · 4 comments · Fixed by #1580
Closed

Labels for fields and replaceFields options do not use localized strings #1578

mtthwprtchrd opened this issue Jul 3, 2024 · 4 comments · Fixed by #1580

Comments

@mtthwprtchrd
Copy link

mtthwprtchrd commented Jul 3, 2024

Description:

When using the fields or replaceFields option the label attribute does not use the string from the language file.
e.g.

jQuery(function ($) {

    var options = {
        i18n: {
            locale: 'en-US',
            location: 'languages',
       },
       replaceFields: [{
        	label: ['dateAndTimeLabel'],
		type: 'date' 
	}]
	}
        var fbEditor = document.getElementById('fb-editor');
        var formBuilder = $(fbEditor).formBuilder(options);
});

What I was originally tying to achieve was to rename the date control to "Date and Time" and have the drop down list say "Date". Currently, they both share the same variable e,g, "dateField" so always end up with a shared string.
e.g.
The circled strings all share the same variable
image

Environment Details:

  • formBuilder Version: v3.19.7
  • Browser: Chrome
  • OS: Windows

Expected Behavior

The label for the object in the replaceFields array should be taken from the language specific file e.g. en-US.lang

Actual Behavior

The label for the object in the replaceFields array just uses the specified string literal.

Steps to Reproduce

See code above

Screenshot - (optional)

Minimal sample

datetest.html.txt
en-US.lang.txt

@lucasnetau
Copy link
Collaborator

Thank you for the reproducer, I have replicated the issue and are preparing a PR to correct.

@lucasnetau
Copy link
Collaborator

Hi @mtthwprtchrd Please test out PR #1580

@mtthwprtchrd
Copy link
Author

Hi @lucasnetau
The PR has resolved my issue.
Thank you very much for the quick response.

Copy link

github-actions bot commented Jul 5, 2024

🎉 This issue has been resolved in version 3.19.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants