diff options
author | Jimmy Cai <github@jimmycai.com> | 2022-06-12 17:26:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 17:26:20 +0300 |
commit | d89def07acfa3df3264e831b999e145ca6321a84 (patch) | |
tree | 33f5e65c7954430d02951ea54258d8b69d5447fa | |
parent | 7a710cbb55d1130e1ea145dce56dcc714a2d9265 (diff) |
feat: i18n support for codeblock copy text
-rw-r--r-- | i18n/en.yaml | 3 | ||||
-rw-r--r-- | layouts/_default/_markup/render-codeblock.html | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/i18n/en.yaml b/i18n/en.yaml index 32223f1..3f94ab1 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -19,6 +19,9 @@ article: readingTime: one: "{{ .Count }} minute read" other: "{{ .Count }} minute read" + codeblock: + copy: Copy + copied: Copied! notFound: title: Not Found diff --git a/layouts/_default/_markup/render-codeblock.html b/layouts/_default/_markup/render-codeblock.html index 052efe3..21c5100 100644 --- a/layouts/_default/_markup/render-codeblock.html +++ b/layouts/_default/_markup/render-codeblock.html @@ -6,9 +6,9 @@ <button class="codeblock-copy" data-id="codeblock-id-{{ .Ordinal }}" - data-copied-text="Copied!" + data-copied-text="{{ T `article.codeblock.copied` }}" > - Copy + {{ T `article.codeblock.copy` }} </button> </header> <code id="codeblock-id-{{ .Ordinal }}" style="display:none;">{{- .Inner -}}</code> |