Change locale

11 views
Skip to first unread message

Leo

unread,
Jul 14, 2011, 10:30:38 AM7/14/11
to visural-wicket
I'm using RichTextEditor component and I want to change the text of
the hints that appears when the mouse is over a button.
Example: When mouse is over the link button, the hint that is shown is
'click to link', I want to change it to 'adicionar um link' (in
portuguese).
How can I do that?

Richard Nichols

unread,
Jul 15, 2011, 2:51:39 AM7/15/11
to visural-wicket
Hi - at the moment the Java-side API doesn't have any hooks to do
this.

The editor is actually the "Nicedit" javascript RTE here - http://nicedit.com/

and I can't see anything in the standard API to customise the buttons.

That said they're definied in the Javascript here -


var nicEditorConfig = bkClass.extend({
buttons : {
'bold' : {name : __('Click to Bold'), command : 'Bold', tags :
['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'},
'italic' : {name : __('Click to Italic'), command : 'Italic', tags :
['EM','I'], css : {'font-style' : 'italic'}, key : 'i'},
'underline' : {name : __('Click to Underline'), command :
'Underline', tags : ['U'], css : {'text-decoration' : 'underline'},
key : 'u'},
'left' : {name : __('Left Align'), command : 'justifyleft',
noActive : true},
'center' : {name : __('Center Align'), command : 'justifycenter',
noActive : true},
'right' : {name : __('Right Align'), command : 'justifyright',
noActive : true},
'justify' : {name : __('Justify Align'), command : 'justifyfull',
noActive : true},
'ol' : {name : __('Insert Ordered List'), command :
'insertorderedlist', tags : ['OL']},
'ul' : {name : __('Insert Unordered List'), command :
'insertunorderedlist', tags : ['UL']},
'subscript' : {name : __('Click to Subscript'), command :
'subscript', tags : ['SUB']},
'superscript' : {name : __('Click to Superscript'), command :
'superscript', tags : ['SUP']},
'strikethrough' : {name : __('Click to Strike Through'), command :
'strikeThrough', css : {'text-decoration' : 'line-through'}},
'removeformat' : {name : __('Remove Formatting'), command :
'removeformat', noActive : true},
'indent' : {name : __('Indent Text'), command : 'indent', noActive :
true},
'outdent' : {name : __('Remove Indent'), command : 'outdent',
noActive : true},
'hr' : {name : __('Horizontal Rule'), command :
'insertHorizontalRule', noActive : true}
},
.....

You may be able to do some Javascript hacking to customise the button
definition on the client side - or package your own version of the
nicEdit.js with the correct translation(s).

You can disable the standard nicEdit.js include by overriding this
method in the RichTextEditor.java -

/**
* Override and return false to suppress static Javascript and CSS
contributions.
* (May be desired if you are concatenating / compressing
resources as part of build process)
* @return
*/
protected boolean autoAddToHeader() {
return true;
}

HTH
Reply all
Reply to author
Forward
0 new messages