internationalize all Asset/RichEdit text

This commit is contained in:
Colin Kuskie 2005-05-03 20:33:07 +00:00
parent 10285b71cf
commit d8a6eb332c
2 changed files with 424 additions and 82 deletions

View file

@ -20,6 +20,7 @@ use WebGUI::Form;
use WebGUI::Macro; use WebGUI::Macro;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Utility; use WebGUI::Utility;
use WebGUI::International;
our @ISA = qw(WebGUI::Asset); our @ISA = qw(WebGUI::Asset);
@ -153,71 +154,75 @@ sub getEditForm {
my %buttons; my %buttons;
tie %buttons, "Tie::IxHash"; tie %buttons, "Tie::IxHash";
%buttons = ( %buttons = (
search => "Find", 'search' => WebGUI::International::get('search', 'Asset_RichEdit'),
replace => "Find and Replace", 'replace' => WebGUI::International::get('replace', 'Asset_RichEdit'),
cut => "Cut", 'cut' => WebGUI::International::get('cut', 'Asset_RichEdit'),
copy => "Copy", 'copy' => WebGUI::International::get('copy', 'Asset_RichEdit'),
paste => "Paste", 'paste' => WebGUI::International::get('paste', 'Asset_RichEdit'),
undo => "Undo", 'undo' => WebGUI::International::get('undo', 'Asset_RichEdit'),
'redo' => "Redo", 'redo' => WebGUI::International::get('redo', 'Asset_RichEdit'),
bold => "Bold", 'bold' => WebGUI::International::get('bold', 'Asset_RichEdit'),
italic => "Italic", 'italic' => WebGUI::International::get('italic', 'Asset_RichEdit'),
underline => "Underline", 'underline' => WebGUI::International::get('underline', 'Asset_RichEdit'),
strikethrough => "Strike Through", 'strikethrough' => WebGUI::International::get('strikethrough', 'Asset_RichEdit'),
justifyleft => "Left Justified", 'justifyleft' => WebGUI::International::get('justifyleft', 'Asset_RichEdit'),
justifycenter => "Centered", 'justifycenter' => WebGUI::International::get('justifycenter', 'Asset_RichEdit'),
justifyright => "Right Justified", 'justifyright' => WebGUI::International::get('justifyright', 'Asset_RichEdit'),
justifyfull => "Fully Justified", 'justifyfull' => WebGUI::International::get('justifyfull', 'Asset_RichEdit'),
bullist => "Bulleted List", 'bullist' => WebGUI::International::get('bullist', 'Asset_RichEdit'),
numlist => "Numbered List", 'numlist' => WebGUI::International::get('numlist', 'Asset_RichEdit'),
outdent => "Outdent", 'outdent' => WebGUI::International::get('outdent', 'Asset_RichEdit'),
indent => "Indent", 'indent' => WebGUI::International::get('indent', 'Asset_RichEdit'),
'sub' => "Subscript", 'sub' => WebGUI::International::get('sub', 'Asset_RichEdit'),
sup => "Superscript", 'sup' => WebGUI::International::get('sup', 'Asset_RichEdit'),
styleselect => "Apply Style", 'styleselect' => WebGUI::International::get('styleselect', 'Asset_RichEdit'),
formatselect => "Apply Format", 'formatselect' => WebGUI::International::get('formatselect', 'Asset_RichEdit'),
fontselect => "Font", 'fontselect' => WebGUI::International::get('fontselect', 'Asset_RichEdit'),
fontsizeselect => "Font Size", 'fontsizeselect' => WebGUI::International::get('fontsizeselect', 'Asset_RichEdit'),
forecolor => "Foreground Color", 'forecolor' => WebGUI::International::get('forecolor', 'Asset_RichEdit'),
backcolor => "Background Color", 'backcolor' => WebGUI::International::get('backcolor', 'Asset_RichEdit'),
'link' => "Create Hyperlink", 'link' => WebGUI::International::get('link', 'Asset_RichEdit'),
# advlink => "Advanced Link", 'pagetree' => WebGUI::International::get('pagetree', 'Asset_RichEdit'),
pagetree => "WebGUI Page Tree Link", 'anchor' => WebGUI::International::get('anchor', 'Asset_RichEdit'),
anchor => "Anchor", 'unlink' => WebGUI::International::get('unlink', 'Asset_RichEdit'),
'unlink' => "Unlink", 'tablecontrols' => WebGUI::International::get('tablecontrols', 'Asset_RichEdit'),
tablecontrols => "Table Controls", 'visualaid' => WebGUI::International::get('visualaid', 'Asset_RichEdit'),
visualaid => "Toggle Table Visual Aid", 'hr' => WebGUI::International::get('hr', 'Asset_RichEdit'),
# spacer => "Toolbar Spacer", 'advhr' => WebGUI::International::get('advhr', 'Asset_RichEdit'),
# separator => "Toolbar Separator", 'inserttime' => WebGUI::International::get('inserttime', 'Asset_RichEdit'),
# rowseparator => "Toolbar Row Separator", 'insertdate' => WebGUI::International::get('insertdate', 'Asset_RichEdit'),
hr => "Insert Horizontal Rule", 'image' => WebGUI::International::get('image', 'Asset_RichEdit'),
advhr => "Advanced Horizontal Rule", 'insertImage' => WebGUI::International::get('insertImage', 'Asset_RichEdit'),
inserttime => "Insert Time", 'flash' => WebGUI::International::get('flash', 'Asset_RichEdit'),
insertdate => "Insert Date", 'charmap' => WebGUI::International::get('charmap', 'Asset_RichEdit'),
image => "Image", 'collateral' => WebGUI::International::get('collateral', 'Asset_RichEdit'),
insertImage => "WebGUI Image", 'emotions' => WebGUI::International::get('emotions', 'Asset_RichEdit'),
# advimage => "Advanced Image", 'help' => WebGUI::International::get('help', 'Asset_RichEdit'),
flash => "Flash Movie", 'iespell' => WebGUI::International::get('iespell', 'Asset_RichEdit'),
charmap => "Special Character", 'removeformat' => WebGUI::International::get('removeformat', 'Asset_RichEdit'),
collateral => "WebGUI Macro", 'code' => WebGUI::International::get('code', 'Asset_RichEdit'),
emotions => "Emoticons", 'cleanup' => WebGUI::International::get('cleanup', 'Asset_RichEdit'),
help => "Help", 'save' => WebGUI::International::get('save', 'Asset_RichEdit'),
iespell => "Spell Checker (IE Only)", 'preview' => WebGUI::International::get('preview', 'Asset_RichEdit'),
removeformat => "Remove Formatting", 'zoom' => WebGUI::International::get('zoom', 'Asset_RichEdit'),
code => "View/Edit Source", 'print' => WebGUI::International::get('print', 'Asset_RichEdit'),
cleanup => "Clean Up Code", # 'advlink' => "Advanced Link",
save => "Save / Submit", # 'spacer' => "Toolbar Spacer",
preview => "Preview", # 'separator' => "Toolbar Separator",
zoom => "Zoom (IE Only)", # 'rowseparator' => "Toolbar Row Separator",
'print' => "Print", # 'advimage' => "Advanced Image",
); );
my $buttonGrid = '<table style="font-size: 11px;"> my $buttonGrid = sprintf qq!<table style="font-size: 11px;">
<tr style="font-weight: bold;"> <tr style="font-weight: bold;">
<td>Button</td> <td>%s</td>
<td>Row 1</td> <td>%s</td>
<td>Row 2</td> <td>%s</td>
<td>Row 3</td> <td>%s</td>
</tr>'; </tr>!,
WebGUI::International::get('button','Asset_RichEdit'),
WebGUI::International::get('row 1','Asset_RichEdit'),
WebGUI::International::get('row 2','Asset_RichEdit'),
WebGUI::International::get('row 3','Asset_RichEdit');
my @toolbarRow1 = split("\n",$self->getValue("toolbarRow1")); my @toolbarRow1 = split("\n",$self->getValue("toolbarRow1"));
my @toolbarRow2 = split("\n",$self->getValue("toolbarRow2")); my @toolbarRow2 = split("\n",$self->getValue("toolbarRow2"));
my @toolbarRow3 = split("\n",$self->getValue("toolbarRow3")); my @toolbarRow3 = split("\n",$self->getValue("toolbarRow3"));
@ -250,93 +255,94 @@ sub getEditForm {
} }
$buttonGrid .= "</table>"; $buttonGrid .= "</table>";
$tabform->getTab("properties")->readOnly( $tabform->getTab("properties")->readOnly(
-label=>"Toolbar Buttons", -label=>WebGUI::International::get('toolbar buttons', 'Asset_RichEdit'),
-value=>$buttonGrid -value=>$buttonGrid
); );
$tabform->getTab("properties")->yesNo( $tabform->getTab("properties")->yesNo(
-value=>$self->getValue("askAboutRichEdit"), -value=>$self->getValue("askAboutRichEdit"),
-label=>"Ask user about using rich edit?", -label=>WebGUI::International::get('using rich edit', 'Asset_RichEdit'),
-name=>"askAboutRichEdit" -name=>"askAboutRichEdit"
); );
$tabform->getTab("properties")->yesNo( $tabform->getTab("properties")->yesNo(
-value=>$self->getValue("preformatted"), -value=>$self->getValue("preformatted"),
-label=>"Preserve whitespace as preformatted text?", -label=>WebGUI::International::get('preformatted', 'Asset_RichEdit'),
-name=>"preformatted", -name=>"preformatted",
-uiLevel=>9 -uiLevel=>9
); );
$tabform->getTab("security")->textarea( $tabform->getTab("security")->textarea(
-value=>$self->getValue("extendedValidElements"), -value=>$self->getValue("extendedValidElements"),
-name=>"extendedValidElements", -name=>"extendedValidElements",
-label=>"Extended Valid Elements", -label=>WebGUI::International::get('extended elements', 'Asset_RichEdit'),
-subtext=>"<br /> Must appear on one line, no carriage returns.", -subtext=>WebGUI::International::get('extended elements subtext', 'Asset_RichEdit'),
-uiLevel=>9 -uiLevel=>9
); );
$tabform->getTab("display")->integer( $tabform->getTab("display")->integer(
-value=>$self->getValue("editorHeight"), -value=>$self->getValue("editorHeight"),
-label=>"Editor Height", -label=>WebGUI::International::get('editor height', 'Asset_RichEdit'),
-name=>"editorHeight", -name=>"editorHeight",
-uiLevel=>9 -uiLevel=>9
); );
$tabform->getTab("display")->integer( $tabform->getTab("display")->integer(
-value=>$self->getValue("editorWidth"), -value=>$self->getValue("editorWidth"),
-label=>"Editor Width", -label=>WebGUI::International::get('editor width', 'Asset_RichEdit'),
-name=>"editorWidth", -name=>"editorWidth",
-uiLevel=>9 -uiLevel=>9
); );
$tabform->getTab("display")->integer( $tabform->getTab("display")->integer(
-value=>$self->getValue("sourceEditorHeight"), -value=>$self->getValue("sourceEditorHeight"),
-label=>"Source Editor Height", -label=>WebGUI::International::get('source editor height', 'Asset_RichEdit'),
-name=>"sourceEditorHeight" -name=>"sourceEditorHeight"
); );
$tabform->getTab("display")->integer( $tabform->getTab("display")->integer(
-value=>$self->getValue("sourceEditorWidth"), -value=>$self->getValue("sourceEditorWidth"),
-label=>"Source Editor Width", -label=>WebGUI::International::get('source editor width', 'Asset_RichEdit'),
-name=>"sourceEditorWidth" -name=>"sourceEditorWidth"
); );
$tabform->getTab("properties")->yesNo( $tabform->getTab("properties")->yesNo(
-value=>$self->getValue("useBr"), -value=>$self->getValue("useBr"),
-label=>"Use &lt;br /&gt; instead of &lt;p&gt; on 'Enter'?", -label=>WebGUI::International::get('use br', 'Asset_RichEdit'),
-name=>"useBr", -name=>"useBr",
-uiLevel=>9 -uiLevel=>9
); );
$tabform->getTab("properties")->yesNo( $tabform->getTab("properties")->yesNo(
-value=>$self->getValue("removeLineBreaks"), -value=>$self->getValue("removeLineBreaks"),
-label=>"Remove line breaks from HTML?", -label=>WebGUI::International::get('remove line breaks', 'Asset_RichEdit'),
-name=>"removeLineBreaks", -name=>"removeLineBreaks",
-uiLevel=>9 -uiLevel=>9
); );
$tabform->getTab("display")->yesNo( $tabform->getTab("display")->yesNo(
-value=>$self->getValue("nowrap"), -value=>$self->getValue("nowrap"),
-label=>"Do not wrap text in editor?", -label=>WebGUI::International::get('no wrap', 'Asset_RichEdit'),
-name=>"nowrap", -name=>"nowrap",
-uiLevel=>9 -uiLevel=>9
); );
$tabform->getTab("properties")->selectList( $tabform->getTab("properties")->selectList(
-value=>[$self->getValue("directionality")], -value=>[$self->getValue("directionality")],
-label=>"Text Direction", -label=>WebGUI::International::get('directionality', 'Asset_RichEdit'),
-name=>"directionality", -name=>"directionality",
-options=>{ -options=>{
ltr=>"Left To Right", ltr=>WebGUI::International::get('left to right', 'Asset_RichEdit'),
rtl=>"Right To Left" rtl=>WebGUI::International::get('right to left', 'Asset_RichEdit'),
} }
); );
$tabform->getTab("display")->selectList( $tabform->getTab("display")->selectList(
-value=>[$self->getValue("toolbarLocation")], -value=>[$self->getValue("toolbarLocation")],
-label=>"Toolbar Location", -label=>"Toolbar Location",
-label=>WebGUI::International::get('toolbar location', 'Asset_RichEdit'),
-name=>"toolbarLocation", -name=>"toolbarLocation",
-options=>{ -options=>{
top=>"Top", top=>WebGUI::International::get('top', 'Asset_RichEdit'),
bottom=>"Bottom" bottom=>WebGUI::International::get('bottom', 'Asset_RichEdit'),
} }
); );
$tabform->getTab("properties")->text( $tabform->getTab("properties")->text(
-value=>$self->getValue("cssFile"), -value=>$self->getValue("cssFile"),
-label=>"CSS File", -label=>WebGUI::International::get('css file', 'Asset_RichEdit'),
-name=>"cssFile" -name=>"cssFile"
); );
$tabform->getTab("properties")->yesNo( $tabform->getTab("properties")->yesNo(
-value=>$self->getValue("enableContextMenu"), -value=>$self->getValue("enableContextMenu"),
-label=>"Enable Context Menu", -label=>WebGUI::International::get('enable context menu', 'Asset_RichEdit'),
-name=>"enableContextMenu" -name=>"enableContextMenu"
); );
return $tabform; return $tabform;

View file

@ -0,0 +1,336 @@
package WebGUI::i18n::English::Asset_RichEdit;
our $I18N = {
'toolbar buttons' => {
message => q|Toolbar Buttons|,
lastUpdated => 1115139736,
},
'using rich edit' => {
message => q|Ask user about using rich edit?|,
lastUpdated => 1115139819,
},
'preformatted' => {
message => q|Preserve whitespace as preformatted text?|,
lastUpdated => 1115139859,
},
'extended elements' => {
message => q|Extended Valid Elements|,
lastUpdated => 1115148094,
},
'extended elements subtext' => {
message => q|<br /> Must appear on one line, no carriage returns.|,
lastUpdated => 1115148094,
},
'editor height' => {
message => q|Editor Height|,
lastUpdated => 1115148094,
},
'editor width' => {
message => q|Editor Width|,
lastUpdated => 1115148094,
},
'source editor height' => {
message => q|Source Editor Height|,
lastUpdated => 1115148094,
},
'source editor width' => {
message => q|Source Editor Width|,
lastUpdated => 1115148094,
},
'use br' => {
message => q|Use &lt;br /&gt; instead of &lt;p&gt; on 'Enter'?|,
lastUpdated => 1115148632,
},
'remove line breaks' => {
message => q|Remove line breaks from HTML?|,
lastUpdated => 1115148632,
},
'no wrap' => {
message => q|Do not wrap text in editor?|,
lastUpdated => 1115148094,
},
'directionality' => {
message => q|Text Direction|,
lastUpdated => 1115148847,
},
'left to right' => {
message => q|Left to Right|,
lastUpdated => 1115148094,
},
'right to left' => {
message => q|Right to Left|,
lastUpdated => 1115148094,
},
'toolbar location' => {
message => q|Toolbar Location|,
lastUpdated => 1115148094,
},
'top' => {
message => q|Top|,
lastUpdated => 1115148094,
},
'bottom' => {
message => q|Bottom|,
lastUpdated => 1115148094,
},
'css file' => {
message => q|CSS File|,
lastUpdated => 1115148094,
},
'enable context menu' => {
message => q|Enable Context Menu|,
lastUpdated => 1115148094,
},
'search' => {
message => q|Find|,
lastUpdated => 1115150778,
},
'replace' => {
message => q|Find and Replace|,
lastUpdated => 1115150778,
},
'cut' => {
message => q|Cut|,
lastUpdated => 1115150778,
},
'copy' => {
message => q|Copy|,
lastUpdated => 1115150778,
},
'paste' => {
message => q|Paste|,
lastUpdated => 1115150778,
},
'undo' => {
message => q|Undo|,
lastUpdated => 1115150778,
},
'redo' => {
message => q|Redo|,
lastUpdated => 1115150778,
},
'bold' => {
message => q|Bold|,
lastUpdated => 1115150778,
},
'italic' => {
message => q|Italic|,
lastUpdated => 1115150778,
},
'underline' => {
message => q|Underline|,
lastUpdated => 1115150778,
},
'strikethrough' => {
message => q|Strike Through|,
lastUpdated => 1115150778,
},
'justifyleft' => {
message => q|Left Justified|,
lastUpdated => 1115150778,
},
'justifycenter' => {
message => q|Centered|,
lastUpdated => 1115150778,
},
'justifyright' => {
message => q|Right Justified|,
lastUpdated => 1115150778,
},
'justifyfull' => {
message => q|Fully Justified|,
lastUpdated => 1115150778,
},
'bullist' => {
message => q|Bulleted List|,
lastUpdated => 1115150778,
},
'numlist' => {
message => q|Numbered List|,
lastUpdated => 1115150778,
},
'outdent' => {
message => q|Outdent|,
lastUpdated => 1115150778,
},
'indent' => {
message => q|Indent|,
lastUpdated => 1115150778,
},
'sub' => {
message => q|Subscript|,
lastUpdated => 1115150778,
},
'sup' => {
message => q|Superscript|,
lastUpdated => 1115150778,
},
'styleselect' => {
message => q|Apply Style|,
lastUpdated => 1115150778,
},
'formatselect' => {
message => q|Apply Format|,
lastUpdated => 1115150778,
},
'fontselect' => {
message => q|Font|,
lastUpdated => 1115150778,
},
'fontsizeselect' => {
message => q|Font Size|,
lastUpdated => 1115150778,
},
'forecolor' => {
message => q|Foreground Color|,
lastUpdated => 1115150778,
},
'backcolor' => {
message => q|Background Color|,
lastUpdated => 1115150778,
},
'link' => {
message => q|Create Hyperlink|,
lastUpdated => 1115150778,
},
'pagetree' => {
message => q|WebGUI Page Tree Link|,
lastUpdated => 1115150778,
},
'anchor' => {
message => q|Anchor|,
lastUpdated => 1115150778,
},
'unlink' => {
message => q|Unlink|,
lastUpdated => 1115150778,
},
'tablecontrols' => {
message => q|Table Controls|,
lastUpdated => 1115150778,
},
'visualaid' => {
message => q|Toggle Table Visual Aid|,
lastUpdated => 1115150778,
},
'hr' => {
message => q|Insert Horizontal Rule|,
lastUpdated => 1115150778,
},
'advhr' => {
message => q|Advanced Horizontal Rule|,
lastUpdated => 1115150778,
},
'inserttime' => {
message => q|Insert Time|,
lastUpdated => 1115150778,
},
'insertdate' => {
message => q|Insert Date|,
lastUpdated => 1115150778,
},
'image' => {
message => q|Image|,
lastUpdated => 1115150778,
},
'insertImage' => {
message => q|WebGUI Image|,
lastUpdated => 1115150778,
},
'flash' => {
message => q|Flash Movie|,
lastUpdated => 1115150778,
},
'charmap' => {
message => q|Special Character|,
lastUpdated => 1115150778,
},
'collateral' => {
message => q|WebGUI Macro|,
lastUpdated => 1115150778,
},
'emotions' => {
message => q|Emoticons|,
lastUpdated => 1115150778,
},
'help' => {
message => q|Help|,
lastUpdated => 1115150778,
},
'iespell' => {
message => q|Spell Checker (IE Only)|,
lastUpdated => 1115150778,
},
'removeformat' => {
message => q|Remove Formatting|,
lastUpdated => 1115150778,
},
'code' => {
message => q|View/Edit Source|,
lastUpdated => 1115150778,
},
'cleanup' => {
message => q|Clean Up Code|,
lastUpdated => 1115150778,
},
'save' => {
message => q|Save / Submit|,
lastUpdated => 1115150778,
},
'preview' => {
message => q|Preview|,
lastUpdated => 1115150778,
},
'zoom' => {
message => q|Zoom (IE Only)|,
lastUpdated => 1115150778,
},
'print' => {
message => q|Print|,
lastUpdated => 1115150778,
},
'button' => {
message => q|Button|,
lastUpdated => 1115150778,
},
'row 1' => {
message => q|Row 1|,
lastUpdated => 1115150778,
},
'row 2' => {
message => q|Row 2|,
lastUpdated => 1115150778,
},
'row 3' => {
message => q|Row 3|,
lastUpdated => 1115150778,
},
};
1;