Skip to content
New issue

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

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

Already on GitHub? # to your account

i18n string is altered to title case #1394

Closed
mtthwprtchrd opened this issue Aug 22, 2023 · 2 comments
Closed

i18n string is altered to title case #1394

mtthwprtchrd opened this issue Aug 22, 2023 · 2 comments
Labels

Comments

@mtthwprtchrd
Copy link

Description:

There is an issue when the i18n string is altered to title case e.g. each word in a phrase is capitalised, in my case "Read-only" is altered to read "Read-Only".

Environment Details:

  • formBuilder Version: 3.8.2
  • Browser: Chrome 115.0.5790.171 (Official Build) (64-bit)
  • OS: Windows 10

Expected Behavior

Original case of i18n string is respected.

Actual Behavior

The case of the i18n string is altered to title case e.g. "Read-only" becomes "Read-Only"

Steps to Reproduce

See the customAttribute string in the code pen below.

The English string "Select {count} options" becomes "Select 3 Options".
The German string "Wählen Sie {count} Optionen aus" becomes "Wählen Sie 3 Optionen Aus".

https://codepen.io/Matthew-Pritchard/pen/vYvEomQ

Screenshot - (optional)

@lucasnetau
Copy link
Collaborator

This transformation is done via CSS (text-transform: capatalize). You can add this rule to your stylesheet to override.

.form-wrap.form-builder .frmb .form-elements .false-label:first-child, .form-wrap.form-builder .frmb .form-elements label:first-child {
    text-transform: none;
}

One thing you'll notice is the shape options are showing the german translation for the colours. You need to define red/green/blue translations in the en-US lang list too.

              "en-US": {
                  red: "Red",
                  green: "Green",
                  blue: "Blue",
              },

@mtthwprtchrd
Copy link
Author

Thanks @lucasnetau. That's resolved the issue.

BTW I really appreciate your efforts in bringing this project back to life.

I've closed this isue now.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants