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

Translation ability for "bad" input value messages in Firefox #32

Closed
emilyuhde opened this issue Jun 20, 2019 · 4 comments
Closed

Translation ability for "bad" input value messages in Firefox #32

emilyuhde opened this issue Jun 20, 2019 · 4 comments
Labels
enhancement New feature or request stale

Comments

@emilyuhde
Copy link
Contributor

emilyuhde commented Jun 20, 2019

Firefox allows non-numeric characters to be input into type="number" inputs, so invalid values can be added to the hour/minute/second inputs of the time picker. This is fine, but when one of these values is entered, in Firefox a title message is displayed in English stating a warning. I set my browser language to German and the messages are still appearing in English, so it looks like they aren't auto translating based on locale.

  1. Just a question, where are the messages coming from? I searched the react-time-picker repo and didn't see the strings anywhere.
  2. I need the ability to translate and/or turn off these messages for my product that's using the react-time-picker. Adding the ability to do that to the library would be very helpful.

Screen Shot 2019-06-20 at 9 12 20 AM

@emilyuhde emilyuhde changed the title Translation ability for "bad" inputs values in Firefox Translation ability for "bad" input value messages in Firefox Jun 20, 2019
@wojtekmaj
Copy link
Owner

Hi,
what you are looking at is native form validation. The text you're seeing is set by the browser you're using and depends on your browser's locale.

It is possible to overwrite this behavior with your own validation methods with your own messages. I certainly like this idea, even though it's hell lot of work to get right!

@wojtekmaj wojtekmaj added the enhancement New feature or request label Jun 20, 2019
@emilyuhde
Copy link
Contributor Author

I found this post on Stackoverflow that was helpful for this, if anyone wants to override the messages themselves using setCustomValidity:

https://stackoverflow.com/a/5276722

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label Sep 27, 2021
@github-actions
Copy link
Contributor

This issue was closed because it has been stalled for 14 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants