Make “Comment” button translatable.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 1 Mar 2012 07:28:14 +0000 (08:28 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 1 Mar 2012 07:28:14 +0000 (08:28 +0100)
src/main/resources/i18n/sone.en.properties
src/main/resources/i18n/sone.fr.properties
src/main/resources/i18n/sone.ru.properties
src/main/resources/static/javascript/sone.js

index b8fb463..ac15636 100644 (file)
@@ -413,6 +413,7 @@ WebInterface.DefaultText.Option.PostCutOffLength=Number of characters for the sn
 WebInterface.DefaultText.Option.PositiveTrust=The positive trust to assign
 WebInterface.DefaultText.Option.NegativeTrust=The negative trust to assign
 WebInterface.DefaultText.Option.TrustComment=The comment to set in the web of trust
+WebInterface.Button.Comment=Comment
 WebInterface.Confirmation.DeletePostButton=Yes, delete!
 WebInterface.Confirmation.DeleteReplyButton=Yes, delete!
 WebInterface.SelectBox.Choose=Choose…
index c4b468f..7572ec9 100644 (file)
@@ -413,6 +413,7 @@ WebInterface.DefaultText.Option.PostCutOffLength=Number of characters for the sn
 WebInterface.DefaultText.Option.PositiveTrust=La note de confiance positive à assigner
 WebInterface.DefaultText.Option.NegativeTrust=Une note de confiance négative à assigner
 WebInterface.DefaultText.Option.TrustComment=Le commentaire à mettre dans le "Web of Trust"
+WebInterface.Button.Comment=Commenter
 WebInterface.Confirmation.DeletePostButton=Oui, effacer!
 WebInterface.Confirmation.DeleteReplyButton=Oui, effacer!
 WebInterface.SelectBox.Choose=Choisir...
index b525070..ad75d11 100644 (file)
@@ -413,6 +413,7 @@ WebInterface.DefaultText.Option.PostCutOffLength=Количество симво
 WebInterface.DefaultText.Option.PositiveTrust=Положительное доверие для назначения
 WebInterface.DefaultText.Option.NegativeTrust=Отрицательное доверие для назначения
 WebInterface.DefaultText.Option.TrustComment=Комментарий для установки в web of trust
+WebInterface.Button.Comment=Comment
 WebInterface.Confirmation.DeletePostButton=Да, удалить!
 WebInterface.Confirmation.DeleteReplyButton=Да, удалить!
 WebInterface.SelectBox.Choose=Выбрать…
index 6afb232..100e9db 100644 (file)
@@ -67,30 +67,31 @@ function addCommentLink(postId, author, element, insertAfterThisElement) {
        if (($(element).find(".show-reply-form").length > 0) || (getPostElement(element).find(".create-reply").length == 0)) {
                return;
        }
-       commentElement = (function(postId, author) {
+       (function(postId, author, insertAfterThisElement) {
                separator = $("<span> · </span>").addClass("separator");
-               var commentElement = $("<div><span>Comment</span></div>").addClass("show-reply-form").click(function() {
-                       replyElement = $("#sone .post#post-" + postId + " .create-reply");
-                       replyElement.removeClass("hidden");
-                       replyElement.removeClass("light");
-                       (function(replyElement) {
-                               replyElement.find("input.reply-input").blur(function() {
-                                       if ($(this).hasClass("default")) {
-                                               replyElement.addClass("light");
-                                       }
-                               }).focus(function() {
-                                       replyElement.removeClass("light");
-                               });
-                       })(replyElement);
-                       textArea = replyElement.find("input.reply-input").focus().data("textarea");
-                       if (author != getCurrentSoneId()) {
-                               textArea.val(textArea.val() + "@sone://" + author + " ");
-                       }
+               getTranslation("WebInterface.Button.Comment", function(text) {
+                       commentElement = $("<div><span>" + text + "</span></div>").addClass("show-reply-form").click(function() {
+                               replyElement = $("#sone .post#post-" + postId + " .create-reply");
+                               replyElement.removeClass("hidden");
+                               replyElement.removeClass("light");
+                               (function(replyElement) {
+                                       replyElement.find("input.reply-input").blur(function() {
+                                               if ($(this).hasClass("default")) {
+                                                       replyElement.addClass("light");
+                                               }
+                                       }).focus(function() {
+                                               replyElement.removeClass("light");
+                                       });
+                               })(replyElement);
+                               textArea = replyElement.find("input.reply-input").focus().data("textarea");
+                               if (author != getCurrentSoneId()) {
+                                       textArea.val(textArea.val() + "@sone://" + author + " ");
+                               }
+                       });
+                       $(insertAfterThisElement).after(commentElement.clone(true));
+                       $(insertAfterThisElement).after(separator);
                });
-               return commentElement;
-       })(postId, author);
-       $(insertAfterThisElement).after(commentElement.clone(true));
-       $(insertAfterThisElement).after(separator);
+       })(postId, author, insertAfterThisElement);
 }
 
 var translations = {};
@@ -1923,8 +1924,10 @@ $(document).ready(function() {
        getTranslation("WebInterface.Confirmation.DeletePostButton", function(text) {
                getTranslation("WebInterface.Confirmation.DeleteReplyButton", function(text) {
                        getTranslation("WebInterface.DefaultText.Reply", function(text) {
-                               $("#sone .post").each(function() {
-                                       ajaxifyPost(this);
+                               getTranslation("WebInterface.Button.Comment", function(text) {
+                                       $("#sone .post").each(function() {
+                                               ajaxifyPost(this);
+                                       });
                                });
                        });
                });