summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-04-06 22:32:48 +0200
committerczaks <marcin@6irc.net>2014-04-06 22:32:48 +0200
commit28033fe6f35558b017b52f2564e3a2149cdd0c51 (patch)
treed82b8d56b675db5a6048e598ca35b275e6cff8c6
parent5c38368e600d04f4d2055a97c0b57a6dea520bd5 (diff)
webm i18n
-rw-r--r--js/expand-video.js10
-rw-r--r--js/webm-settings.js12
2 files changed, 15 insertions, 7 deletions
diff --git a/js/expand-video.js b/js/expand-video.js
index 530b8cac..d2e35249 100644
--- a/js/expand-video.js
+++ b/js/expand-video.js
@@ -1,6 +1,10 @@
/* This file is dedicated to the public domain; you may do as you wish with it. */
/* Note: This code expects the global variable configRoot to be set. */
+if (typeof _ == 'undefined') {
+ var _ = function(a) { return a; };
+}
+
function setupVideo(thumb, url) {
var video = null;
var videoContainer, videoHide;
@@ -38,7 +42,7 @@ function setupVideo(thumb, url) {
video = document.createElement("video");
video.src = url;
video.loop = loop;
- video.innerText = "Your browser does not support HTML5 video.";
+ video.innerText = _("Your browser does not support HTML5 video.");
videoHide = document.createElement("img");
videoHide.src = configRoot + "static/collapse.gif";
@@ -182,8 +186,8 @@ function setupVideo(thumb, url) {
}, false);
}
- loopControls[0].textContent = "[play once]";
- loopControls[1].textContent = "[loop]";
+ loopControls[0].textContent = _("[play once]");
+ loopControls[1].textContent = _("[loop]");
loopControls[1].style.fontWeight = "bold";
for (var i = 0; i < 2; i++) {
setupLoopControl(i);
diff --git a/js/webm-settings.js b/js/webm-settings.js
index 6b1ed45c..cecf36d0 100644
--- a/js/webm-settings.js
+++ b/js/webm-settings.js
@@ -1,5 +1,9 @@
/* This file is dedicated to the public domain; you may do as you wish with it. */
+if (typeof _ == 'undefined') {
+ var _ = function(a) { return a; };
+}
+
// Default settings
var defaultSettings = {
"videoexpand": true,
@@ -35,11 +39,11 @@ var settingsMenu = document.createElement("div");
settingsMenu.style.textAlign = "right";
settingsMenu.style.background = "inherit";
-settingsMenu.innerHTML = '<a class="unimportant" href="javascript:void(0)"><span>WebM Settings</span></a>'
+settingsMenu.innerHTML = '<a class="unimportant" href="javascript:void(0)"><span>'+_('WebM Settings')+'</span></a>'
+ '<div style="display: none; text-align: left; position: absolute; right: 1em; margin-left: -999em; margin-top: -1px; padding-top: 1px; background: inherit;">'
- + '<label><input type="checkbox" name="videoexpand">Expand videos inline</label><br>'
- + '<label><input type="checkbox" name="videohover">Play videos on hover</label><br>'
- + '<label><input type="range" name="videovolume" min="0" max="1" step="0.01" style="width: 4em; height: 1ex; vertical-align: middle; margin: 0px;">Default volume</label><br>'
+ + '<label><input type="checkbox" name="videoexpand">'+_('Expand videos inline')+'</label><br>'
+ + '<label><input type="checkbox" name="videohover">'+_('Play videos on hover')+'</label><br>'
+ + '<label><input type="range" name="videovolume" min="0" max="1" step="0.01" style="width: 4em; height: 1ex; vertical-align: middle; margin: 0px;">'+_('Default volume')+'</label><br>'
+ '</div>';
function refreshSettings() {