Bug 1047405: Comment tagging GUI not fully localizable because of text in Javascript instead of template

r=sgreen,a=glob


git-svn-id: svn://10.0.0.236/trunk@265494 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2014-08-14 06:15:50 +00:00
parent 562c045d02
commit 9b016949ac
4 changed files with 16 additions and 5 deletions

View File

@ -1 +1 @@
9104 9105

View File

@ -1 +1 @@
424b21e37cd9aeac01588ce0defd3ee665944b1d 2cb85ad6cba30c44bdaf3d9c5cc7c1ad1fadd416

View File

@ -20,6 +20,10 @@ YAHOO.bugzilla.commentTagging = {
can_edit : false, can_edit : false,
pending : {}, pending : {},
label : '',
min_len_error: '',
max_len_error: '',
init : function(can_edit) { init : function(can_edit) {
this.can_edit = can_edit; this.can_edit = can_edit;
this.ctag_div = Dom.get('bz_ctag_div'); this.ctag_div = Dom.get('bz_ctag_div');
@ -185,7 +189,7 @@ YAHOO.bugzilla.commentTagging = {
tags.sort(); tags.sort();
if (tags.length) { if (tags.length) {
var div = document.createElement('div'); var div = document.createElement('div');
div.appendChild(document.createTextNode('Comment Tags:')); div.appendChild(document.createTextNode(this.label));
var ul = document.createElement('ul'); var ul = document.createElement('ul');
ul.id = 'comment_tags_collapse_expand'; ul.id = 'comment_tags_collapse_expand';
div.appendChild(ul); div.appendChild(ul);
@ -260,9 +264,9 @@ YAHOO.bugzilla.commentTagging = {
if (tag == '') if (tag == '')
continue; continue;
if (tag.length < YAHOO.bugzilla.commentTagging.min_len) 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) 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 // append new tag
if (bz_isValueInArrayIgnoreCase(tags, tag)) if (bz_isValueInArrayIgnoreCase(tags, tag))
continue; continue;

View File

@ -29,6 +29,13 @@
YAHOO.bugzilla.commentTagging.init([% user.can_tag_comments ? 'true' : 'false' %]); 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.min_len = [% constants.MIN_COMMENT_TAG_LENGTH FILTER js %];
YAHOO.bugzilla.commentTagging.max_len = [% constants.MAX_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> </script>
[% END %] [% END %]
[% END %] [% END %]