Skip to content

Commit

Permalink
Try to fix the language switching problem
Browse files Browse the repository at this point in the history
Fix #260.
  • Loading branch information
xfq committed Apr 23, 2021
1 parent 40f2be4 commit 0476dc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="local.css" />

<script async class="remove" src="https://www.w3.org/Tools/respec/respec-w3c"></script>
<script defer src="script.js"></script>
<script src="script.js"></script>

<script class="remove">
var respecConfig = {
Expand Down Expand Up @@ -54,12 +54,13 @@
//wgPublicList: "public-i18n-cjk",
edDraftURI: "https://w3c.github.io/jlreq/",
github: "w3c/jlreq",
postProcess: [setFrontMatterIds, initialiseLang],
};
</script>
</head>


<body onload="setFrontMatterIds(); /*addLangAttrs();*/ initialiseLang()">
<body onload="/*setFrontMatterIds();*/ /*addLangAttrs();*/ initialiseLang()">
<h1 class="title p-name" id="title">Requirements for Japanese Text Layout <br/><span lang="ja">日本語組版処理の要件(日本語版)</span></h1>

<div id="abstract">
Expand Down
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function switchLang (lang) {



function setFrontMatterIds () {
function setFrontMatterIds (config, document) {
// adds ids to dt elements in front matter to facilitate language switching

var dts = document.querySelectorAll('dt')
Expand Down Expand Up @@ -148,7 +148,7 @@ function addLangAttrs () { console.log("THIS FUNCTION IS NO LONGER NEEDED")
}


function initialiseLang () {
function initialiseLang (config, document) {
// if a lang= parameter is passed with the URL, show in that language
var parameters = location.search.split('&')
parameters[0] = parameters[0].substring(1)
Expand Down

0 comments on commit 0476dc3

Please sign in to comment.