logoalt Hacker News

robin_realayesterday at 2:36 PM1 replyview on HN

Or the Nordics ”like this” or the UK ‘like this’ or Japan 「like this」. Basically every country has their own standard: https://en.wikipedia.org/wiki/Quotation_mark#Summary_table


Replies

keaneyesterday at 10:10 PM

This is why the <q> element exists which enables locale-aware quotation marks: https://w3c.github.io/i18n-drafts/questions/qa-the-q-element...

  :root:lang(en) { quotes: '“' '”' '‘' '’' }
  :root:lang(fr) { quotes: '«' '»' '«' '»' }
  :root:lang(fr-CA) { quotes: '«' '»' '‹' '›' }
  q:before { content: open-quote; }
  q:after { content: close-quote; }
There's currently 26 quotation mark varieties by default (in Firefox): https://searchfox.org/firefox-main/source/intl/locale/cldr-q... which are sourced from the Unicode Common Locale Data Repository: https://github.com/unicode-org/cldr/tree/main/common/main