Skip to main content Skip to secondary navigation

Identify non-English text

Main content start

English is the primary language supported on Stanford Sites. Stanford Sites does not support localization or translation sets — but you can mark individual passages of text in another language using the lang attribute.

It's important to understand what this support does and doesn't cover. Adding the lang attribute tells browsers and assistive technology what language a passage is written in — it does not guarantee that language will render or behave correctly on the page. Support for scripts, alignment, and typography varies by language. For example, you can mark Arabic text with lang="ar", but Stanford Sites doesn't guarantee proper right-to-left alignment or rendering for it.

If your page includes text in another language, we still strongly recommend adding the lang attribute, since it improves accessibility and browser behavior even when full visual rendering isn't guaranteed. Benefits include:

  • Appropriate intonation and pronunciation by screen readers
  • Browser translation support
  • Correct font rendering for different scripts
  • Correct hyphenation and line breaks

For example, given this text in French:

Using inspect through the browser, you can see the lang attribute in action. 

Add the lang attribute to non-English text

The text editor makes it easy to add the lang attribute to a single word or an entire paragraph. 

  1. Select the non-English text. (Note that if the text is not contiguous, you will need to repeat this for each part.)
  2. Click the Show more items button (the three vertical dots ( ⋮ )) at the end of the tool bar to bring up the Choose Language dropdown menu.
  3. Scroll through the menu to find the appropriate language and click on it. Within the text editor, you should see the associated language attribute displayed in small font at the end of the word, list item, paragraph, etc.

 

Lang attribute resources

  • More on the lang attribute: Using the HTML lang attribute
  • Find a language tag: Language subtag lookup 
  • lang attributes available in the text editor:
    • Afrikaans
    • Albanian
    • Amharic
    • Arabic
    • Armenian
    • Asturian
    • Azerbaijani
    • Basque
    • Belarusian
    • Bengali
    • Bosnian
    • Breton
    • Bulgarian
    • Burmese
    • Catalan
    • Chinese, Simplified
    • Chinese, Traditional
    • Croatian
    • Czech
    • Danish
    • Dutch
    • Dzongkha
    • English
    • English, British
    • Esperanto
    • Estonian
    • Faeroese
    • Filipino
    • Finnish
    • French
    • Frisian, Western
    • Galician
    • Georgian
    • German
    • Greek
    • Gujarati
    • Haitian Creole
    • Hawaiian
    • Hebrew
    • Hindi
    • Hungarian
    • Icelandic
    • Indonesian
    • Irish
    • Italian
    • Japanese
    • Javanese
    • Kannada
    • Kazakh
    • Khmer
    • Kinyarwanda
    • Korean
    • Kurdish
    • Kyrgyz
    • Lao
    • Latvian
    • Lithuanian
    • Lolspeak
    • Macedonian
    • Malagasy
    • Malay
    • Malayalam
    • Maltese
    • Marathi
    • Mongolian
    • Nepali
    • Northern Sami
    • Norwegian Bokmål
    • Norwegian Nynorsk
    • Occitan
    • Odia
    • Ossetian
    • Pashto
    • Persian, Afghanistan
    • Persian, Farsi
    • Polish
    • Portuguese, Brazil
    • Portuguese, International
    • Portuguese, Portugal
    • Punjabi
    • Rohingya
    • Romanian
    • Rumantsch Grischun
    • Russian
    • Scots
    • Scots Gaelic
    • Serbian
    • Simple English
    • Sinhala
    • Slovak
    • Slovenian
    • Spanish
    • Swahili
    • Swedish
    • Swiss German
    • Tamil
    • Tamil, Sri Lanka
    • Telugu
    • Thai
    • Tibetan
    • Turkish
    • Tuvan
    • Ukrainian
    • Urdu
    • Uyghur
    • Vietnamese
    • Welsh

Related Topics

desk step with different typography elements
Learn about the most flexible tool you have with the Text Area Paragraph.
Stanford Web Services (SWS) is committed to providing a Stanford Sites environment that enables site owners to build and manage websites that are accessible to everyone and adhere to Stanford's online accessibility policy.