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

Language switching doesn't work for the spec metadata #260

Closed
xfq opened this issue Apr 5, 2021 · 8 comments · Fixed by #264
Closed

Language switching doesn't work for the spec metadata #260

xfq opened this issue Apr 5, 2021 · 8 comments · Fixed by #264
Labels
jlreq-doc:enhancement [JLReq-doc] possible enhancement items on 2nd edition

Comments

@xfq
Copy link
Member

xfq commented Apr 5, 2021

After clicking 日本語 in https://w3c.github.io/jlreq/, the spec content is changed to Japanese, but the spec metadata section ("This version:", "Latest published version:", "Latest editor's draft:", "Editors:" etc.) is still in English.

https://www.w3.org/TR/jlreq/ works fine.

@himorin
Copy link
Contributor

himorin commented Apr 5, 2021

mm.. working for me now.
could you try to reload (or super-reload??) and test?

@xfq
Copy link
Member Author

xfq commented Apr 6, 2021

I tried it in Chrome 89, Safari 14.0.3, and Firefox 87 after clearing the cache and disabling the extensions, but it still doesn't work for me.


Expected result:

expected


What I saw:

happened

@himorin
Copy link
Contributor

himorin commented Apr 6, 2021

one possibility is a processing order of scripts. let me take some time to rewrite current switching initialization code using postProcess of respec, not onload.

@r12a
Copy link
Contributor

r12a commented Apr 6, 2021

My experience is as follows:

/TR works as expected on Firefox, Chrome, Safari !
(so we should carefully check whether something changed in the ED...)

Editor's draft:
Firefox works
Safari doesn't work
Chrome didn't work until i installed the latest version (!) but now works
The version i'm now using is Version 89.0.4389.114

This is all on Mac Big Sur.

@himorin i suggest trying to understand the changes that lead to the problem in the ED before rewriting the code. If it works in TR but not always in the ED, what changed?

@himorin
Copy link
Contributor

himorin commented Apr 6, 2021

Not a root cause, but the behavior seems "adding id to dt" is failing.
/TR/ has processed HTML tree by initialization code, but ED is not.
While reloading many times, I've encountered longer run of respec script and got an warning that some deferred scripts were not called xx seconds after load (or something similar), and got the same behavior (labels does not change with switching language).

For "doesn't work" ones, could you please try to:

  • open developer console (or something similar one, usually via F12)
  • go to 'console' tab, and type 'setFrontMatterIds()'

If this fixes, the root cause is functions set to onload run before end of respec processing (adding head section incl. the part under discussion).

@himorin
Copy link
Contributor

himorin commented Apr 6, 2021

One possible change could be some W3C API (used within respec) returns with longer processing time than before...

@xfq
Copy link
Member Author

xfq commented Apr 7, 2021

For "doesn't work" ones, could you please try to:

  • open developer console (or something similar one, usually via F12)
  • go to 'console' tab, and type 'setFrontMatterIds()'

If this fixes, the root cause is functions set to onload run before end of respec processing (adding head section incl. the part under discussion).

Running setFrontMatterIds() in the console indeed fixed the issue for the editor's draft.

And I just tried reloading the /TR version a few times and found that it doesn't work sometimes (and setFrontMatterIds() can fix it too).

@himorin
Copy link
Contributor

himorin commented Apr 7, 2021

Thank you for confirming that setFrontMatterIds() fixes the issue.
And interesting for /TR version.. One possibility, we have defer on script loading, and using body onload for execution. So missorder of execution could happen which results to undefined error of functions set to onload,,,??

Anyway, I think all could be fixed with moving setFrontMatterIds into postprocess of respec (and having initialiseLang at both onload and postprocess?), since it will build processed HTML tree (with appropriate id-s to dt-s) - adding id-s after HTML tree built by respec for ED and statically for /TR.

xfq added a commit that referenced this issue Apr 23, 2021
@himorin himorin added the jlreq-doc:enhancement [JLReq-doc] possible enhancement items on 2nd edition label May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jlreq-doc:enhancement [JLReq-doc] possible enhancement items on 2nd edition
Projects
None yet
3 participants