Opened 12 years ago
Closed 11 years ago
#9213 closed enhancement (worksforme)
i18n for ColorPicker
Reported by: | KuRoz | Owned by: | Adam Peller |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | DojoX Widgets | Version: | 1.3.0 |
Keywords: | thai display ColorPicker | Cc: | [email protected]…, dante, Jared Jurkiewicz |
Blocked By: | Blocking: |
Description (last modified by )
I've modified part of ColorPicker?.js to make it capable of Thai display. (You have to add dojo.require("dojo.cldr.supplemental"); to all of modified class)
var _2=function(_3){ return _3; }; var rWord="r"; var gWord="g"; var bWord="b"; var hWord="h"; var sWord="s"; var vWord="v"; var hexWord="hex"; if(dojo.cldr.supplemental._region(this.lang)=="th"){ rWord="อาร์"; gWord="จี"; bWord="บี"; hWord="เอช"; sWord="เอส"; vWord="วี"; hexWord="เลขฐานสิบหก";} dojo.declare("dojox.widget.ColorPicker",dijit.form._FormWidget,{showRgb:true,showHsv:true,showHex:true,webSafe:true,animatePoint:true,slideDuration:250,liveUpdate:false,PICKER_HUE_H:150,PICKER_SAT_VAL_H:150,PICKER_SAT_VAL_W:150,value:"#ffffff",_underlay:d.moduleUrl("dojox.widget","ColorPicker/images/underlay.png"),templateString:" \n\t \n\t\t \n\t\t\n\t \n\t \n\t\t \n\t\t \n\t \n\t \n\t \n\t \n\t\t \n\t\t\t\n\t\t\t"+rWord+"\n\t\t\t"+gWord+"\n\t\t\t"+bWord+"\n\t\t\t\n\t\t \n\t\t \n\t\t\t\n\t\t\t "+hWord+" °\n\t\t\t "+sWord+" %\n\t\t\t "+vWord+" %\n\t\t\t\n\t\t \n\t\t \t\n\t\t\t "+hexWord+": \n\t\t \n\t \n \n",postCreate:function(){ this.inherited(arguments);
And modified part of ColorPicker?.css to make it size suitable for Thai display.
.dojoxColorPicker { padding:8px; border:1px solid #a0a0a0; background:#ededed; width:400px; height:150px; -moz-border-radius:4pt; -webkit-border-radius:5pt; }
Change History (11)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 12 years ago by
Without posting any source code, can you describe the problem? What's wrong with the ColorPicker? running in Thai as the code stands? (graphic attachments are ok) There are translations for each color in the palette at dojo/nls/th/colors.js, though for some reason they're only partially translated.
comment:3 Changed 12 years ago by
Oh, sorry, I didn't realize this was dojox.widget.ColorPicker? (was thinking of dijit.ColorPicker?, which should work ok in Thai) Yes, this widget, like most widgets in dojox.widget, need to be "globalized" using dojo.i18n and resource bundles. Is there any logic that is specific to Thai which must be considered?
comment:5 Changed 11 years ago by
@dante, I moved the resources to strings. Can we change the layout to use relative positioning instead of absolute, or perhaps just a bigger table, to accommodate the different sized strings?
comment:6 Changed 11 years ago by
Summary: | thai display ColorPicker → i18n for ColorPicker |
---|
comment:7 Changed 11 years ago by
Cc: | dante added |
---|---|
Milestone: | tbd → future |
Owner: | changed from dante to Adam Peller |
@peller - we can. I recall it taking a bunch of effort to get everything "lined up" and the CSS is a bit messy, so If you have an alternate idea, I'd happily entertain it.
comment:8 Changed 11 years ago by
The alternative, without really knowing this code, is to use TABLES instead of CSS for layout. Could be a win, with or without i18n.
comment:10 Changed 11 years ago by
Milestone: | future → 1.5 |
---|
comment:11 Changed 11 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Hi, thanks for the patch but a few things: