w3c / jlreq

Text Layout Requirements for Japanese
https://w3c.github.io/jlreq/
Other
101 stars 17 forks source link

Language switching doesn't work in the ED #231

Closed xfq closed 3 years ago

xfq commented 4 years ago

After https://github.com/w3c/jlreq/pull/230 is merged, language switching doesn't seem to work in the ED now.

Click 日本語 in https://w3c.github.io/jlreq/ and https://w3c.github.io/jlreq/?specStatus=WG-NOTE&publishDate=2020-08-11&previousPublishDate=2012-04-03&previousMaturity=WG-NOTE and compare the results.

Since this problem is not the first time (see #123), I suggest that we write some tests for this functionality and run them with Travis CI.

/cc @r12a

himorin commented 4 years ago

hrm,,, it seems working for me, showing only English (for English button) or only Japanese (for 日本語 button)... Could you point specific point(s) I can check?

xfq commented 4 years ago

The following is a comparison between ED and WG Note after clicking 日本語 (the result is the same for me in Chrome/Firefox/Safari):

ED NOTE

The reason seems to be that "Previous version" cannot be found in the ED, so an uncaught TypeError is emitted.

himorin commented 4 years ago

we don't have previousPublishDate in the HEAD yet, so I think this difference is expected behavior.

kidayasuo commented 4 years ago

What is a right way of testing the function?

xfq commented 4 years ago

we don't have previousPublishDate in the HEAD yet, so I think this difference is expected behavior.

That makes sense.

However, we also need to make the code more robust (for example, by handling the exceptions), otherwise when there's a slight change in the ReSpec config or the spec header template, the entire language switching function may not be able to work correctly.

xfq commented 4 years ago

What is a right way of testing the function?

Not sure if you mean how to test the behavior in the current ED, or how to write some JavaScript tests for this functionality.

If you mean the former, you can just click 日本語 in https://w3c.github.io/jlreq/ to see the result.

If you mean the latter, I guess we need to use some testing framework with a test runner to run it in a browser (or jsdom).

himorin commented 4 years ago

However, we also need to make the code more robust (for example, by handling the exceptions), otherwise when there's a slight change in the ReSpec config or the spec header template, the entire language switching function may not be able to work correctly.

Ah, yes on that point. I wondered whether I've made another mistake for upcoming release (and forgot any other item..). Considering both easy to be noticed and not to make any change to the production (after compiled/exported by respec), how about

r12a commented 4 years ago

I would recommend always testing the switch language functionality by clicking on the buttons (as a user would) before sending a publication request (preferably with the console window open, since there are actually problems associated with the English button, although things appear to work).

@himorin, i think you need to urgently warn the webmaster not to publish until this is fixed, given the time zone differences. Otherwise he may publish while you are sleeping.

himorin commented 4 years ago

@himorin, i think you need to urgently warn the webmaster not to publish until this is fixed, given the time zone differences. Otherwise he may publish while you are sleeping.

As noted above, this error is only at github.io ED, since published one has previousPublishDate but ED not. So, no error is detected with the published one.

xfq commented 4 years ago

I would recommend always testing the switch language functionality by clicking on the buttons (as a user would) before sending a publication request (preferably with the console window open, since there are actually problems associated with the English button, although things appear to work).

This will help, but it is not enough for people reading ED (unless we publish new versions frequently).

himorin commented 3 years ago

closing since #234 was merged.