diff --git a/assets/js/code-copy.js b/assets/js/code-copy.js
index 8af92d5..f4ac628 100644
--- a/assets/js/code-copy.js
+++ b/assets/js/code-copy.js
@@ -5,6 +5,12 @@
(function () {
'use strict';
+ var i18n = (window.wavecast && window.wavecast.i18n) || {};
+ var CODE_COPY_TITLE = i18n.code_copy_title || 'Copy code';
+ var CODE_COPY_LABEL = i18n.code_copy_label || 'Copy code to clipboard';
+ var CODE_COPIED = i18n.code_copied || 'Copied!';
+ var CODE_COPIED_LABEL = i18n.code_copied_label || 'Code copied';
+
// Collect both .highlight wrappers and standalone
elements.
// Filter out that are already inside .highlight (they get a button
// via the parent). Also skip that are empty or inside the
@@ -31,8 +37,8 @@
var btn = document.createElement('button');
btn.className = 'code-copy-btn';
btn.type = 'button';
- btn.title = 'Copy code';
- btn.setAttribute('aria-label', 'Copy code to clipboard');
+ btn.title = CODE_COPY_TITLE;
+ btn.setAttribute('aria-label', CODE_COPY_LABEL);
btn.innerHTML =
'