To be able to edit code and run cells, you need to run the notebook yourself. Where would you like to run the notebook?

This notebook takes about 20 seconds to run.

In the cloud (experimental)

Binder is a free, open source service that runs scientific notebooks in the cloud! It will take a while, usually 2-7 minutes to get a session.

On your computer

(Recommended if you want to store your changes.)

  1. Copy the notebook URL:
  2. Run Pluto

    (Also see: How to install Julia and Pluto)

  3. Paste URL in the Open box

Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

Author 1

This is some English text!

Hellozers!

Voici un texte en Français!

Cici n'est pas un texte

👀 Reading hidden code
"en" => md"""
# This is some English text!

Hellozers!
""",
"fr" => md"""
# Voici un texte en Français!
Cici n'est pas un texte
"""
])
98.6 ms
👀 Reading hidden code
using HypertextLiteral
: @htl, @htl_str

25.6 ms
👀 Reading hidden code
begin
"""
A way to provide multiple translations of the same object. When someone else views your notebook, _their_ system/browser preferences are used to show the translation in _their preferred language_. This allows you to write multilingual material!

# Example
```julia
MultiLingual([
"fr" => "Salut tous le monde !",
"en" => "Hello world!",
])
```

When the result is viewed on a computer with English set as the prefered language, it will say _Hello world!_, and _Salut tous le monde !_ on a French computer.

# Not just strings

`MultiLingual` can be used to provide translations for any object. Most commonly, it can be used to switch between markdown proses:
```julia
MultiLingual([
"fr" => md"\""
471 ms
This is some English text! Salut tous le monde !
ml = MultiLingual(["en" => "This is some English text!", "fr" => "Salut tous le monde !"])
👀 Reading hidden code
22.2 μs

Hello!!!

md"# Hello!!!"
👀 Reading hidden code
177 μs

Salut !!!

Hallo!!!

hello

MultiLingual([
"es" => md"# Salut !!!",
"nl" => md"# Hallo!!!",
"en" => md"hello",
])
👀 Reading hidden code
526 μs
show me not me
ml2 = MultiLingual(["asdfasdf" => "show me", "kjewfkjh" => "not me"])
👀 Reading hidden code
21.2 μs
fake language this is englishz not me
MultiLingual(["asdf" => "fake language", "en-GB" => "this is englishz", "kjewfkjh" => "not me"])
👀 Reading hidden code
21.1 μs

Hello English French speaker

md"""
# Hello $(MultiLingual(["en" => "English", "fr" => "French",])) speaker
"""
👀 Reading hidden code
39.4 ms

👀 Reading hidden code
68.4 μs

TODO

md"""
TODO
"""
👀 Reading hidden code
179 μs
A
@htl("""
<div style='font-family: system-ui'><span style='font-size: .9em'>文</span>A</div>
""")
👀 Reading hidden code
284 ms
@htl("""
<img style='height: 1em; width: 1em;' src='https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.2/src/svg/language-outline.svg'>
""")
👀 Reading hidden code
71.3 μs