🔧 Chore(i18n): add i18n support for console messages

This commit is contained in:
Cell
2022-04-25 11:29:57 +08:00
parent 57f1256811
commit bdc500b14c
16 changed files with 219 additions and 32 deletions
+1
View File
@@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
- :zap: Perf: remove third-party library clipboard.js ([#84](https://github.com/Lruihao/FixIt/issues/84))
- :pencil2: Docs: fix highlight url typo in `theme-documentation-built-in-shortcodes` (@d-baer[#85](https://github.com/Lruihao/FixIt/pull/85))
- :wrench: Chore(i18n): improve translations for supported languages ([#119](https://github.com/Lruihao/FixIt/issues/119))
- :wrench: Chore(i18n): add i18n support for console messages
- :wrench: Chore(deps-dev):
- Bump minimist from 1.2.5 to 1.2.6 ([#92](https://github.com/Lruihao/FixIt/pull/92))
- Bump @babel/core from 7.17.5 to 7.17.9 ([#98](https://github.com/Lruihao/FixIt/pull/98))
+16 -2
View File
@@ -2,13 +2,27 @@
# Übersetzung auf Deutsch
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "nach oben"
[viewComments]
other = "Kommentare anzeigen"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -1,13 +1,27 @@
# Translations for English
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "Configuration Error\nYou haven't configured the FixIt version param correctly yet. See https://fixit.lruihao.cn/theme-documentation-basics/#basic-configuration"
[compatibilityError]
other = "Compatibility Error ({{ .From }} -> {{ .To }}):\nYou have an incompatible update. See https://github.com/Lruihao/FixIt/releases"
[RCVersionWarn]
other = "You are using a development version of FixIt. Please consider using a stable version.\nSee https://github.com/Lruihao/FixIt/releases"
[devEnvWarn]
other = "Current environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled."
# === init ===
# === baseof ===
[backToTop]
other = "Back to Top"
[viewComments]
other = "View Comments"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# Traducciones para español
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Volver arriba"
[viewComments]
other = "Ver comentarios"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# Traductions pour le français
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Retour en Haut"
[viewComments]
other = "Afficher les Commentaires"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# Traduzioni per l'italiano
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Torna all'inizio"
[viewComments]
other = "Vedi commenti"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# Tłumaczenie na język polski
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Powrót do góry"
[viewComments]
other = "Zobacz komentarze"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# Tradução para português do Brasil
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Voltar ao topo"
[viewComments]
other = "Ver comentários"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# Traduceri pentru limba română
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Înapoi Sus"
[viewComments]
other = "Vizualizare Comentarii"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# Переводы на русский
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Наверх"
[viewComments]
other = "Посмотреть комментарии"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# Превод на Српски
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Назад на Врх"
[viewComments]
other = "Погледај Коментаре"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -1,13 +1,27 @@
# Translations for Vietnamese
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "" # waitting for translation
[compatibilityError]
other = "" # waitting for translation
[RCVersionWarn]
other = "" # waitting for translation
[devEnvWarn]
other = "" # waitting for translation
# === init ===
# === baseof ===
[backToTop]
other = "Lên trên"
[viewComments]
other = "Xem bình luận"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# 简体中文的翻译
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "配置文件错误\n您还没有正确配置 FixIt 的版本参数。参考 https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/#basic-configuration"
[compatibilityError]
other = "兼容性错误 ({{ .From }} -> {{ .To }}):\n您进行了一次不兼容的更新。参考 https://github.com/Lruihao/FixIt/releases"
[RCVersionWarn]
other = "您正在使用开发版的 FixIt,请考虑使用稳定版。\n见 https://github.com/Lruihao/FixIt/releases"
[devEnvWarn]
other = "当前运行环境是“development”。“评论系统”,“CDN”和“fingerprint”不会启用。"
# === init ===
# === baseof ===
[backToTop]
other = "回到顶部"
[viewComments]
other = "查看评论"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+16 -2
View File
@@ -2,13 +2,27 @@
# 簡體中文的翻譯
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
# === init ===
[configurationError]
other = "配置文件錯誤\n您還沒有正確配置 FixIt 的版本參數。參考 https://fixit.lruihao.cn/zh-cn/theme-documentation-basics/#basic-configuration"
[compatibilityError]
other = "兼容性錯誤 ({{ .From }} -> {{ .To }}):\n您進行了一次不兼容的更新。参考 https://github.com/Lruihao/FixIt/releases"
[RCVersionWarn]
other = "您正在使用開發版的 FixIt,請考慮使用穩定版。\n見 https://github.com/Lruihao/FixIt/releases"
[devEnvWarn]
other = "當前運行環境是“development”。“評論系統”,“CDN”和“fingerprint”不會啟用。"
# === init ===
# === baseof ===
[backToTop]
other = "回到頂部"
[viewComments]
other = "查看評論"
# === baseof ==
# === baseof ===
# === Post ===
[posts]
+9 -5
View File
@@ -1,12 +1,15 @@
{{- .Scratch.Set "version" "0.2.14" -}}
{{- $version := "v0.2.14-RC" -}}
{{- $VERSION := "0.2.X" -}}
{{- /* FixIt theme version detection */ -}}
{{- $VERSION := "0.2.X" -}}
{{- if eq .Site .Sites.First -}}
{{- if (strings.HasSuffix $version "RC") -}}
{{- warnf "FixIt %v\n%v" $version (T "RCVersionWarn") -}}
{{- end -}}
{{- if not .Site.Params.version -}}
{{- errorf "Configuration Error 配置文件错误\n\nYou haven't configured the FixIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration\n你还没有正确配置 FixIt 的版本参数. 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration\n" -}}
{{- errorf "FixIt %v\n%v" $version (T "configurationError") -}}
{{- else if ne .Site.Params.version $VERSION -}}
{{- errorf (printf "Compatibility Error 兼容性错误\n\n%v -> %v:\nYou have an incompatible update. See https://github.com/Lruihao/FixIt/releases\n你进行了一次不兼容的更新. 参考 https://github.com/Lruihao/FixIt/releases\n" .Site.Params.version $VERSION) -}}
{{- errorf "FixIt %v\n%v" $version (dict "From" .Site.Params.version "To" $VERSION | T "compatibilityError") -}}
{{- end -}}
{{- end -}}
@@ -38,9 +41,10 @@
{{- .Scratch.Set "comment" dict -}}
{{- end -}}
{{- else if eq .Site .Sites.First -}}
{{- warnf "\n\nCurrent environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled.\n当前运行环境是 \"development\". \"评论系统\", \"CDN\" 和 \"fingerprint\" 不会启用.\n" -}}
{{- warnf "FixIt %v\n%v" $version (T "devEnvWarn") -}}
{{- end -}}
{{- .Scratch.Set "version" $version -}}
{{- .Scratch.Set "params" $params -}}
{{- .Scratch.Set "toc" $toc -}}
{{- .Scratch.Set "this" dict -}}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "fixit-src",
"version": "0.2.14",
"version": "0.2.14-RC",
"description": "FixIt theme source files",
"private": true,
"dependencies": {},