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

[B] jqueryui-datepicker fails on Google translated pages #2036

Closed
githubertus opened this issue Dec 5, 2021 · 13 comments
Closed

[B] jqueryui-datepicker fails on Google translated pages #2036

githubertus opened this issue Dec 5, 2021 · 13 comments

Comments

@githubertus
Copy link
Contributor

githubertus commented Dec 5, 2021

I was wondering already some weeks which way people managed to register with a birthdate like NaN/NaN/NaN

Finally, I found the explanation here: https://bugs.jqueryui.com/ticket/8266

And actually you'll get it on an English page translated to German ...
google-translate-datepicker

Possible fix: https://sarathlal.com/stop-google-from-translating-datepicker-input-field/

@lianglee
Copy link
Member

lianglee commented Dec 5, 2021

I think we should also do validation in backend

githubertus added a commit to githubertus/opensource-socialnetwork that referenced this issue Dec 12, 2021
@michieal
Copy link

michieal commented Mar 5, 2022

@githubertus I got it translating the page from english to english. I also tried adding the "notranslate" class to the input, and it didn't change the NaN/NaN/NaN from the field. Was curious to know if you got it to work at all?

@lianglee
Copy link
Member

lianglee commented Mar 7, 2022

@michieal depending on what version of OSSN you are running and did you verified if your birthdate field have notranslate class?

@michieal
Copy link

Ossn 6.1; And I specifically added (and checked in the page source) the notranslate class.

@lianglee
Copy link
Member

@michieal You should check if the change effects the actual element you can use browser view source code to see.

@lianglee
Copy link
Member

lianglee commented Mar 13, 2022 via email

@michieal
Copy link

The "notranslate" class was added to the text input / textarea for the Birthdate field (that's read only). It filled it with NaN's when translated.
So, not sure - I followed the above, and I am pretty sure that I did it right.

@githubertus
Copy link
Contributor Author

Are we talking about THIS site?
nan

@michieal
Copy link

@githubertus -- I used my beta site, not my live site.

@michieal
Copy link

I added this to the profile js:
var args = Ossn.call_hook('profile', 'birthdate:input', null, datepick_args); $("input[name='birthdate']").datepicker(args); $("input[name='birthdate']").addClass('notranslate');

And I also tried this in ossn.lib.users:
'text' => array( array( 'name' => 'birthdate', 'params' => array( 'readonly' => true, 'class' => 'notranslate', // this line here. ) )

@githubertus
Copy link
Contributor Author

Ok, and your beta site is a clean Ossn 6.x without any enabled extras?

@michieal
Copy link

The "notranslate" class was added to the text input / textarea for the Birthdate field (that's read only). It filled it with NaN's when translated.
So, not sure - I followed the above, and I am pretty sure that I did it right.

Ok, and your beta site is a clean Ossn 6.x without any enabled extras?

uhm, not really. my beta site is the last testing zone before making things live. I dev on a vm, but I found out the hard way that there are differences between the vm and it being in the wild; so I made a mostly wild back up copy of the live site to test it one last time before making it live. Only I have access to the beta, as I don't want complete screw ups to be seen... kinda breaks the mystique if others see abject fails on a daily basis. lol

@githubertus
Copy link
Contributor Author

Well, I think we should end the discussion here. This is a place to report and fix bugs occurring in PLAIN VANILLA Ossn, and not in a whatsoever customized derivative. The more if we have no access to it.

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

No branches or pull requests

3 participants