Skip to content

Commit 3a0d70e

Browse files
authored
feat(i18n): add i18n support for Markdown alert (#1269)
* docs: add blockquote with custom alert title * feat: add alert types to i18n and update blockquote rendering * fix: wrong translation key * feat: add alert title translation for all supported languages Done by AI
1 parent 4702951 commit 3a0d70e

35 files changed

Lines changed: 254 additions & 18 deletions

demo/content/post/Markdown Syntax/index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,19 @@ The blockquote element represents content that is quoted from another source, op
4949

5050
### Blockquote with alert
5151

52-
> [!NOTE]
52+
> [!NOTE]
5353
> Highlights information that users should take into account, even when skimming.
5454
55+
> [!NOTE] Custom title
56+
> You can also provide a custom title for the note alert.
57+
5558
> [!TIP]
5659
> Optional information to help a user be more successful.
5760
58-
> [!IMPORTANT]
61+
> [!IMPORTANT]
5962
> Crucial information necessary for users to succeed.
6063
61-
> [!WARNING]
64+
> [!WARNING]
6265
> Critical content demanding immediate user attention due to potential risks.
6366
6467
> [!CAUTION]

demo/content/post/Markdown Syntax/index.zh.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,24 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
4949

5050
### 带提示的引用
5151

52-
> [!NOTE]
52+
> [!NOTE]
5353
> 突出显示用户在快速浏览时也应注意的信息。
5454
5555
> [!TIP]
5656
> 可选信息,帮助用户更顺利地完成任务。
5757
58-
> [!IMPORTANT]
58+
> [!IMPORTANT]
5959
> 用户成功所必需的关键信息。
6060
61-
> [!WARNING]
61+
> [!WARNING]
6262
> 由于潜在风险而需要用户立即关注的关键内容。
6363
6464
> [!CAUTION]
6565
> 某个操作可能带来的负面后果。
6666
67+
> [!NOTE] 自定义标题
68+
> 如果你想使用自定义标题,可以在方括号后面添加标题文本,如上所示。
69+
6770
## 表格 (Tables)
6871

6972
表格虽然不是 Markdown 核心规范的一部分,但 Hugo 出箱即用地支持它们。

i18n/ar.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ darkMode = "الوضع الداكن"
2222
one = "تُقرأ خلال دقيقة"
2323
other = "تُقرأ خلال {{ .Count }} دقائق"
2424

25+
[article.alert]
26+
note = "ملاحظة"
27+
tip = "نصيحة"
28+
important = "مهم"
29+
warning = "تحذير"
30+
caution = "تنبيه"
31+
2532
[notFound]
2633
title = "غير موجود"
2734
subtitle = "تعذر العثور على الصفحة المطلوبة."

i18n/be.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ darkMode = "Цёмны рэжым"
2323
tableOfContents = "Змест"
2424
readingTime = "Час чытання: {{ .Count }} хв."
2525

26+
[article.alert]
27+
note = "Заўвага"
28+
tip = "Парада"
29+
important = "Важна"
30+
warning = "Папярэджанне"
31+
caution = "Асцярога"
32+
2633
[notFound]
2734
title = "Не знойдзена"
2835
subtitle = "Запытваемая старонка не існуе"

i18n/bg.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ darkMode = "Тъмен Режим"
2222
one = "{{ .Count }} minute read"
2323
other = "{{ .Count }} minute read"
2424

25+
[article.alert]
26+
note = "Бележка"
27+
tip = "Съвет"
28+
important = "Важно"
29+
warning = "Предупреждение"
30+
caution = "Внимание"
31+
2532
[notFound]
2633
title = "Не е намерено"
2734
subtitle = "Страницата която търсите не е открита"

i18n/bn.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ darkMode = "ডার্ক মোড"
2222
one = "{{ .Count }} মিনিটে পড়া যাবে"
2323
other = "{{ .Count }} মিনিটে পড়া যাবে"
2424

25+
[article.alert]
26+
note = "টীকা"
27+
tip = "পরামর্শ"
28+
important = "গুরুত্বপূর্ণ"
29+
warning = "সতর্কতা"
30+
caution = "সাবধানতা"
31+
2532
[notFound]
2633
title = "পাওয়া যায়নি"
2734
subtitle = "এই পাতাটি বিদ্যমান নেই"

i18n/ca.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ darkMode = "Mode fosc"
2222
one = "{{ .Count }} minut a llegir"
2323
other = "{{ .Count }} minuts a llegir"
2424

25+
[article.alert]
26+
note = "Nota"
27+
tip = "Consell"
28+
important = "Important"
29+
warning = "Avís"
30+
caution = "Precaució"
31+
2532
[notFound]
2633
title = "No Trobat"
2734
subtitle = "Aquesta pàgina no existeix"

i18n/cs.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ darkMode = "Tmavý režim"
2222
one = "{{ .Count }} minuta"
2323
other = "{{ .Count }} minut"
2424

25+
[article.alert]
26+
note = "Poznámka"
27+
tip = "Tip"
28+
important = "Důležité"
29+
warning = "Varování"
30+
caution = "Upozornění"
31+
2532
[notFound]
2633
title = "Nenalezeno"
2734
subtitle = "Tato stránka neexistuje"

i18n/de.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ darkMode = "Dunkler Modus"
2222
one = "{{ .Count }} Minute Lesezeit"
2323
other = "{{ .Count }} Minuten Lesezeit"
2424

25+
[article.alert]
26+
note = "Hinweis"
27+
tip = "Tipp"
28+
important = "Wichtig"
29+
warning = "Warnung"
30+
caution = "Vorsicht"
31+
2532
[notFound]
2633
title = "Seite nicht gefunden"
2734
subtitle = "Diese Seite existiert nicht"

i18n/el.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ darkMode = "Σκοτεινό θέμα"
2222
one = "{{ .Count }} λεπτό ανάγνωσης"
2323
other = "{{ .Count }} λεπτά ανάγνωσης"
2424

25+
[article.alert]
26+
note = "Σημείωση"
27+
tip = "Συμβουλή"
28+
important = "Σημαντικό"
29+
warning = "Προειδοποίηση"
30+
caution = "Προσοχή"
31+
2532
[notFound]
2633
title = "Δε βρέθηκε"
2734
subtitle = "Η σελίδα δε βρέθηκε."

0 commit comments

Comments
 (0)