mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 19:00:24 +00:00
clipboard: i18n #186
This commit is contained in:
parent
fb9f06d98e
commit
d1cd818357
18 changed files with 193 additions and 8 deletions
|
@ -30,8 +30,7 @@ Code fences without any selected language
|
|||
}
|
||||
````
|
||||
|
||||
<pre><code>
|
||||
{
|
||||
<pre><code>{
|
||||
"well": "some JSON in HTML elements here"
|
||||
}
|
||||
</code></pre>
|
||||
|
|
12
i18n/ar.toml
12
i18n/ar.toml
|
@ -48,3 +48,15 @@ other = "Tip"
|
|||
|
||||
[warning]
|
||||
other = "Warning"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/de.toml
12
i18n/de.toml
|
@ -48,3 +48,15 @@ other = "Tipp"
|
|||
|
||||
[warning]
|
||||
other = "Warnung"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "In Zwischenablage kopieren"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "In Zwischenablage kopiert!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Link in Zwischenablage kopieren"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Link in Zwischenablage kopiert!"
|
||||
|
|
12
i18n/en.toml
12
i18n/en.toml
|
@ -48,3 +48,15 @@ other = "Tip"
|
|||
|
||||
[warning]
|
||||
other = "Warning"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/es.toml
12
i18n/es.toml
|
@ -48,3 +48,15 @@ other = "Consejo"
|
|||
|
||||
[warning]
|
||||
other = "Aviso"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/fr.toml
12
i18n/fr.toml
|
@ -48,3 +48,15 @@ other = "Astuce"
|
|||
|
||||
[warning]
|
||||
other = "Avertissement"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/hi.toml
12
i18n/hi.toml
|
@ -48,3 +48,15 @@ other = "Tip"
|
|||
|
||||
[warning]
|
||||
other = "Warning"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/id.toml
12
i18n/id.toml
|
@ -48,3 +48,15 @@ other = "Tip"
|
|||
|
||||
[warning]
|
||||
other = "Warning"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/ja.toml
12
i18n/ja.toml
|
@ -48,3 +48,15 @@ other = "Tip"
|
|||
|
||||
[warning]
|
||||
other = "Warning"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/nl.toml
12
i18n/nl.toml
|
@ -48,3 +48,15 @@ other = "Tip"
|
|||
|
||||
[warning]
|
||||
other = "Warning"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
|
@ -48,3 +48,15 @@ other = "Smarrrt arrrse"
|
|||
|
||||
[warning]
|
||||
other = "Arrr"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy t' clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied t' clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link t' clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link t' clipboard!"
|
||||
|
|
12
i18n/pt.toml
12
i18n/pt.toml
|
@ -48,3 +48,15 @@ other = "Dica"
|
|||
|
||||
[warning]
|
||||
other = "Aviso"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/ru.toml
12
i18n/ru.toml
|
@ -48,3 +48,15 @@ other = "Совет"
|
|||
|
||||
[warning]
|
||||
other = "Внимание"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/tr.toml
12
i18n/tr.toml
|
@ -48,3 +48,15 @@ other = "Tip"
|
|||
|
||||
[warning]
|
||||
other = "Warning"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
12
i18n/vn.toml
12
i18n/vn.toml
|
@ -51,3 +51,15 @@ other = "Mẹo vặt"
|
|||
|
||||
[warning]
|
||||
other = "Cảnh báo"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
|
@ -48,3 +48,15 @@ other = "提示"
|
|||
|
||||
[warning]
|
||||
other = "警告"
|
||||
|
||||
[Copy-to-clipboard]
|
||||
other = "Copy to clipboard"
|
||||
|
||||
[Copied-to-clipboard]
|
||||
other = "Copied to clipboard!"
|
||||
|
||||
[Copy-link-to-clipboard]
|
||||
other = "Copy link to clipboard"
|
||||
|
||||
[Link-copied-to-clipboard]
|
||||
other = "Copied link to clipboard!"
|
||||
|
|
|
@ -46,6 +46,12 @@
|
|||
}
|
||||
</script>
|
||||
{{- end }}
|
||||
<script>
|
||||
window.T_Copy_to_clipboard = '{{ T "Copy-to-clipboard" | safeJS }}';
|
||||
window.T_Copied_to_clipboard = '{{ T "Copied-to-clipboard" | safeJS }}';
|
||||
window.T_Copy_link_to_clipboard = '{{ T "Copy-link-to-clipboard" | safeJS }}';
|
||||
window.T_Link_copied_to_clipboard = '{{ T "Link-copied-to-clipboard" | safeJS }}';
|
||||
</script>
|
||||
<script src="{{"js/relearn.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||
{{- partial "custom-footer.html" . }}
|
||||
</body>
|
||||
|
|
|
@ -348,14 +348,14 @@ jQuery(function() {
|
|||
clip.on('success', function(e) {
|
||||
e.clearSelection();
|
||||
var inPre = $(e.trigger).parent().parent().prop('tagName') == 'PRE';
|
||||
$(e.trigger).attr('aria-label', 'Copied to clipboard!').addClass('tooltipped tooltipped-' + (inPre ? 'w' : 's'));
|
||||
$(e.trigger).attr('aria-label', window.T_Copied_to_clipboard).addClass('tooltipped tooltipped-' + (inPre ? 'w' : 's'));
|
||||
});
|
||||
|
||||
clip.on('error', function(e) {
|
||||
var inPre = $(e.trigger).parent().parent().prop('tagName') == 'PRE';
|
||||
$(e.trigger).attr('aria-label', fallbackMessage(e.action)).addClass('tooltipped tooltipped-' + (inPre ? 'w' : 's'));
|
||||
$(document).one('copy', function(){
|
||||
$(e.trigger).attr('aria-label', 'Copied to clipboard!').addClass('tooltipped tooltipped-' + (inPre ? 'w' : 's'));
|
||||
$(e.trigger).attr('aria-label', window.T_Copied_to_clipboard).addClass('tooltipped tooltipped-' + (inPre ? 'w' : 's'));
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -366,7 +366,7 @@ jQuery(function() {
|
|||
code.addClass('copy-to-clipboard-code');
|
||||
code.replaceWith($('<span/>', {'class': 'copy-to-clipboard'}).append(code.clone() ));
|
||||
code = parent.children('.copy-to-clipboard').last().children('.copy-to-clipboard-code');
|
||||
code.after('<span class="copy-to-clipboard-button" title="Copy to clipboard"><i class="fas fa-copy"></i>');
|
||||
code.after( $('<span>').addClass("copy-to-clipboard-button").attr("title", window.T_Copy_to_clipboard).append("<i class='fas fa-copy'></i>") );
|
||||
code.next('.copy-to-clipboard-button').on('mouseleave', function() {
|
||||
$(this).attr('aria-label', null).removeClass('tooltipped tooltipped-s tooltipped-w');
|
||||
});
|
||||
|
@ -513,7 +513,7 @@ jQuery(function() {
|
|||
var element = $(this);
|
||||
var url = encodeURI(document.location.origin + document.location.pathname);
|
||||
var link = url + "#"+element[0].id;
|
||||
var html = " " + $( "<span>" ).addClass("anchor").attr("data-clipboard-text", link).append("<i class='fas fa-link fa-lg'></i>").get(0).outerHTML;
|
||||
var html = " " + $( '<span>' ).addClass("anchor").attr("title", window.T_Copy_link_to_clipboard).attr("data-clipboard-text", link).append("<i class='fas fa-link fa-lg'></i>").get(0).outerHTML;
|
||||
return html;
|
||||
});
|
||||
|
||||
|
@ -522,8 +522,8 @@ jQuery(function() {
|
|||
});
|
||||
|
||||
clip.on('success', function(e) {
|
||||
e.clearSelection();
|
||||
$(e.trigger).attr('aria-label', 'Link copied to clipboard!').addClass('tooltipped tooltipped-s');
|
||||
e.clearSelection();
|
||||
$(e.trigger).attr('aria-label', window.T_Link_copied_to_clipboard).addClass('tooltipped tooltipped-s');
|
||||
});
|
||||
|
||||
$('a[rel="lightbox"]').featherlight({
|
||||
|
|
Loading…
Reference in a new issue