clipboard: i18n #186

This commit is contained in:
Sören Weber 2022-02-17 20:09:50 +01:00
parent fb9f06d98e
commit d1cd818357
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
18 changed files with 193 additions and 8 deletions

View file

@ -30,8 +30,7 @@ Code fences without any selected language
}
````
<pre><code>
{
<pre><code>{
"well": "some JSON in HTML elements here"
}
</code></pre>

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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!"

View file

@ -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>

View file

@ -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({