Site migration from WP to 11ty in progress. Some things may be temporarily broken.
Skip to main content

Icelandic and Language of Parts

Key Takeaways:

Jump to section titled: Key Takeaways:
  • Specifying a language change in text makes your content more understandable.
  • Language changes can be noted through HTML elements or PDF tag properties.

Winter is here (in the North)

Jump to section titled: Winter is here (in the North)

Winter is here in SE Alaska. We've reached mid-December, so I'm seeing a flurry of community event announcements. Recently, I read an announcement from my public library inviting people to their adaption of Jólabókaflóð (Christmas Book Flood). Their poster invites patrons to, "check out a book, movie, or game and pick out a chocolate treat to celebrate the winter holidays" between December 19-31.

Screenshot from the header of the library flyer. A mug of hot cocoa sits on a book next to the title 'Jólabókaflóð (Icelandic Book Flood.)'

With accessibility often on my mind, my library's poster got me thinking about "Language of Parts", success criterion 3.1.2 from the WCAG (Web Content Accessibility Guidelines). I confess, I don't know any Icelandic and would likely butcher how Jólabókaflóð would be said aloud. To my embarrassment, the first thing that comes to my mind when I think Iceland is Will Ferrell's comedic role in Eurovision Song Contest. Regardless, it wouldn't stop me from making any written Icelandic text accessible to people using assistive technology.

Why is it important?

Jump to section titled: Why is it important?

The "Language of Parts" criterion makes webpage content understandable. Specifying a change in language alerts technologies in a few ways:

In turn, those technologies give people a clearer understanding of content and context:

But how does one specify a language change?

Noting a change in language

Jump to section titled: Noting a change in language

Fortunately, a change of language within a sentence is straightforward in HTML. Wrap the foreign word in a span element with a lang attribute:

<span lang="is">
  Jólabókaflóð
</span>

Or, if a paragraph creates a change in language, then that paragraph element can have the same lang attribute. The following code could be useful on this Tlingit Language learning page:

<p lang="tli">
  Yakʼéi haat yee.ádi, ldakát yeewháan. Yá daakeit áwé, ldakát uháan yís áyá. Áwé, x̲ʼatulitseen haa léelkʼu has yoo x̲ʼatángi. Haa jiyís áyá wdudliyéx̲. Aaa. Haa Tlagu K̲wáanxʼi Yan, Haa Yoo X̲ʼatángi, k̲a Haa K̲usteeyí, haa jeet has awatée.
</p>

Alternate (alt) text for images can be trickier. The img element accepts a lang attribute, but the language change indicates the entire image. So, if you have Icelandic and English text together in an image, the language attribute can only identify it as one language. Another good reason to avoid trapping text inside images, huh?

But what about a PDF? WCAG 2.1 Techniques advises updating the /Lang entry of the tag that wraps the foreign text. Adobe Acrobat Pro's pre-populated language list isn't extensive. (It doesn't include Icelandic nor any Alaska Native languages). However, you can specify a language, such as Icelandic, by typing in its ISO 639-2 code.

Screenshot of Adobe Acrobat Pro's Object Properties dialog. The Language select box is open, displaying 16 languages: Brazilian, Chinese, Danish, Dutch, English, English UK, English US, Finnish, French, German, Italian, Japanese, Korean, Norwegian, Spanish, and Swedish.

But do these techniques really work to benefit all users?

A word about ISO codes

Jump to section titled: A word about ISO codes

The International Organization for Standards assigned ISO language codes to languages and language groups. The US's Library of Congress (LOC) hosts a page of ISO-639-1 and ISO 639-2 codes that represent names of languages. The LOC page hasn't been updated since December 12, 2017, but at least they included many Alaska Native languages, unlike Wikipedia's ISO language list.

A word about screen readers

Jump to section titled: A word about screen readers

Just because a language code exists, doesn't mean a screen reader supports that language. I can understand that some languages are still in the process of being revived and documented, such as various Alaska Native languages. However, I dare to dream that one day in the future, Alaska Natives who rely on assistive tech, like screen readers, will experience the joy of reading their own language on the web.

NVDA

Jump to section titled: NVDA

By default, NVDA switches its language output for words, phrases, or pages that specify the language being used. It has the ability to report what language it's switching to, but that feature has to be turned on. It will also announce what language is being used if the specified language is not available. NVDA supports over 60 languages, including Icelandic. They don't yet support any of the twenty Alaska Native languages.

You can read about NVDA's language switching on their docs site.

JAWS

Jump to section titled: JAWS

JAWS supports 54 languages, available through its Vocalizer Expressive Version 2 synthesizer download. JAWS, also, switches its language output for words, phrases, or pages that specify the language being used. If their synthesizer doesn't support that language, it will announce the language being used.

VoiceOver

Jump to section titled: VoiceOver

According to Apple's "Feature Availability" page, VoiceOver supports 62 languages. Icelandic is not on that list. When testing this post with VoiceOver (VO) on my macOS Sequoia 15.6.1 on Safari 18.6, I was not notified of the change in language (Icelandic) nor told that the word was Icelandic.

Interestingly, VO made an attempt to prononunce the Tlingit text in my code example, despite a lack of code to notify the screen reader that it was a different language on the page.

A word about the English language

Jump to section titled: A word about the English language

English has borrowed many words and phrases from other languages. If you can find it in the dictionary, you shouldn't need to note a change in language.

In closing

Jump to section titled: In closing

If you made it this far, thanks for going down this rabbit hole with me. To my fellow northern hemisphere folks, I now invite you to go forth and read a cozy book during our winter season and drink a cup of hot cocoa. And, as always, keep making digital things accessible.