Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurData committed Sep 23, 2024
1 parent fcd782b commit 98648cd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# I18n Extension For Quarto

i18n extension for Quarto helps to manage multiple languages in your documents.
i18n extension for Quarto helps to **manage multiple languages** in your documents. You can use it with a default language or with a language selector.

## Installing

Expand All @@ -12,6 +12,8 @@ quarto add ArthurData/quarto-i18n
## Usage

### Use the default language

You can use it to manage multiple languages in your documents.

Firstly, you can use it with a default language:
Expand Down Expand Up @@ -44,20 +46,29 @@ revealjs-plugins:
<span data-i18n-key="getting-up"></span>
```

or you can use it with a select input to change the language:
In this case, the default language is Italian. You will not be able to change the language.

### Use the language selector

You can also use a language selector to change the language of your document.

This extension came with a language selector that you can add to your document.

```r
{{< i18n-select choices="fr:Français, en:English" selected="fr" >}}
```

This will add a dropdown to your document that will allow you to change the language. The `choices` attribute is a list of languages that you want to display in the dropdown. The `selected` attribute is the default language.

`fr` is the key of the language and `Français` is the value that will be displayed in the dropdown.

```r
---
title: Revealjs i18n
format:
revealjs:
footer: |
<select id="data-i18n-switcher" class="reaveljs-select">
<option selected class="drop-item" value="en">English</option>
<option class="drop-item" value="fr">French</option>
<option class="drop-item" value="de">Deutsch</option>
<option class="drop-item" value="it">Italian</option>
</select>
{{< i18n-select choices="fr:Français, en:English, de:Deutsch, it:Italiano" selected="fr" >}}
i18n:
defaultLocale: "fr"
fr:
Expand Down
Binary file modified i18n.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 98648cd

Please sign in to comment.