]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1047405: Comment tagging GUI not fully localizable because of text in Javascript...
authorByron Jones <glob@mozilla.com>
Thu, 14 Aug 2014 06:05:54 +0000 (14:05 +0800)
committerByron Jones <glob@mozilla.com>
Thu, 14 Aug 2014 06:05:54 +0000 (14:05 +0800)
r=sgreen,a=glob

js/comment-tagging.js
template/en/default/bug/edit.html.tmpl

index 987dfd8dafbe7858d6b862282e984a58a9bcacff..f488000e104f0e11911649d03f961101d7e23b1a 100644 (file)
@@ -20,6 +20,10 @@ YAHOO.bugzilla.commentTagging = {
     can_edit  : false,
     pending   : {},
 
+    label        : '',
+    min_len_error: '',
+    max_len_error: '',
+
     init : function(can_edit) {
         this.can_edit = can_edit;
         this.ctag_div = Dom.get('bz_ctag_div');
@@ -185,7 +189,7 @@ YAHOO.bugzilla.commentTagging = {
         tags.sort();
         if (tags.length) {
             var div = document.createElement('div');
-            div.appendChild(document.createTextNode('Comment Tags:'));
+            div.appendChild(document.createTextNode(this.label));
             var ul = document.createElement('ul');
             ul.id = 'comment_tags_collapse_expand';
             div.appendChild(ul);
@@ -260,9 +264,9 @@ YAHOO.bugzilla.commentTagging = {
             if (tag == '')
                 continue;
             if (tag.length < YAHOO.bugzilla.commentTagging.min_len)
-                throw new Error("Comment tags must be at least " + this.min_len + " characters.");
+                throw new Error(this.min_len_error)
             if (tag.length > YAHOO.bugzilla.commentTagging.max_len)
-                throw new Error("Comment tags cannot be longer than " + this.min_len + " characters.");
+                throw new Error(this.max_len_error)
             // append new tag
             if (bz_isValueInArrayIgnoreCase(tags, tag))
                 continue;
index 6917a89ecfec240664c194bf2ac4ddba9839fe8a..ca0e771e06ba8b7d58d6c579354ca41c00cf30c3 100644 (file)
       YAHOO.bugzilla.commentTagging.init([% user.can_tag_comments ? 'true' : 'false' %]);
       YAHOO.bugzilla.commentTagging.min_len = [% constants.MIN_COMMENT_TAG_LENGTH FILTER js %];
       YAHOO.bugzilla.commentTagging.max_len = [% constants.MAX_COMMENT_TAG_LENGTH FILTER js %];
+      YAHOO.bugzilla.commentTagging.label = 'Comment Tags:';
+      YAHOO.bugzilla.commentTagging.min_len_error =
+        'Comment tags must be at least
+        [%~ " " _ constants.MIN_COMMENT_TAG_LENGTH FILTER js %] characters.';
+      YAHOO.bugzilla.commentTagging.max_len_error =
+        'Comment tags cannot be longer than
+        [%~ " " _ constants.MAX_COMMENT_TAG_LENGTH FILTER js %] characters.';
     </script>
   [% END %]
 [% END %]