3 ms·
the lang="en" always irritates me. What if the page has mixed language content? e.g. on the /r/france/ reddit. The page says lang="en" because every subreddit
by est 1y ago
the lang="en" always irritates me.
What if the page has mixed language content?
e.g. on the /r/france/ reddit. The page says lang="en" because every subreddit shares the same template. But actual content were generated by French speaking users.
- zeroq 1y agoYou can add lang attributes to elements too! https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/lang https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
- acdha 1y agoThis is one of the great parts of the web: you can tag every element with the global lang attribute and have things work the way you expect. For example, you can have CSS generate the appropriate quotation marks even in nested contexts so you can painlessly use <q> tags to markup scholarly articles even if the site itself is translated and thus would have different nested quotation marks for, say, the French version embedding an English quote including a French quote or vice versa. In your Reddit example, the top level page should be in the user’s preferred site language with individual posts or other elements using author’s language: <html lang=en>…<div lang=fr>
- Telaneo 1y agolang="" if you don't know what language your page will be in. <html lang="en">, and then <p lang="fr"> on whatever other language content. Content from users that aren't tagged to be in a specific language doesn't really fit into this system though. https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/lang https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
- est 1y agoThat sounds good in theory. On bsky.social you are supposed to choose a lang before posting. But again there's mixed language issue Or do users even bother to choose the correct lang?