Re: [jlreq] Make the language switching code more robust (#234)

we may not have any additional code for check or debug in the future, but how about to add one function like below for ease of maintenance and modification.

```
// as replaceHeaders('editors', translations[lang].editors);
function replaceHeaders (target, translated) {
    if (document.getElementById(target)) {
        document.getElementById(target).textContent = translated;
    }
}
```

-- 
GitHub Notification of comment by himorin
Please view or discuss this issue at https://github.com/w3c/jlreq/pull/234#issuecomment-674486877 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 16 August 2020 06:36:28 UTC