PDA

View Full Version : [FIXED-1040] RadioGroup works with hardcoded english texts



abtrapp
11 Jun 2010, 7:09 AM
German browser:



xtype: 'textfield',
required: true,
leads to "Dieses Feld darf nicht leer sein" (correct)



xtype: 'radiogroup',
required: true,
leads to "You must select one item in this group" (wrong)

extjs 3.2.1

A




if(Ext.form.CheckboxGroup){
Ext.apply(Ext.form.CheckboxGroup.prototype, {
minLengthText : "Bitte geben Sie mindestens {0} Zeichen ein",
maxLengthText : "Bitte geben Sie maximal {0} Zeichen ein",
blankText : "Dieses Feld darf nicht leer sein",
regexText : "",
emptyText : null
});
}


in the extjs language file does not fix the issue.

evant
28 Jun 2010, 8:10 PM
This isn't really a bug, it's just the translations are missing from the .de file. For example:



if(Ext.form.CheckboxGroup){
Ext.apply(Ext.form.CheckboxGroup.prototype, {
blankText : "Foo"
});
}

if(Ext.form.CheckboxGroup){
Ext.apply(Ext.form.RadioGroup.prototype, {
blankText : "Bar"
});
}


If you (or another German speaker) could provide the appropriate wording I can update the file. That would be great!

abtrapp
28 Jun 2010, 8:55 PM
I think it is a bug. Your solution (looks like my code above - or am I to blind to see the difference) does not change the text in my case. I have to do this:


// RadioGroup
Ext.ux.form.RadioGroup = Ext.extend(Ext.form.RadioGroup, {
blankText: "Whatever",
});
Ext.reg('workingradiogroup', Ext.ux.form.RadioGroup);

and use the workingradiogroup component to override the english default text. Imho


if(Ext.form.CheckboxGroup){
Ext.apply(Ext.form.RadioGroup.prototype, {
blankText : "Bar"
});
}

should do the same, but it does not. I can live with this issue, just wanted to report it :)

evant
28 Jun 2010, 8:58 PM
I had a typo, it should have been:



if(Ext.form.CheckboxGroup){
Ext.apply(Ext.form.CheckboxGroup.prototype, {
blankText : "Foo"
});
}

if(Ext.form.RadioGroup){
Ext.apply(Ext.form.RadioGroup.prototype, {
blankText : "Bar"
});
}


It definitely works, you just need the extra stuff in your language file. Could you please provide the translations?

evant
28 Jun 2010, 9:00 PM
if(Ext.form.CheckboxGroup){
Ext.apply(Ext.form.CheckboxGroup.prototype, {
blankText : "Foo"
});
}

if(Ext.form.RadioGroup){
Ext.apply(Ext.form.RadioGroup.prototype, {
blankText : "Bar"
});
}

Ext.onReady(function(){
Ext.QuickTips.init();
new Ext.form.FormPanel({
width: 600,
height: 600,
renderTo: document.body,
items: [{
width: 300,
allowBlank: false,
xtype: 'checkboxgroup',
msgTarget: 'side',
items: [{
boxLabel: 'Foo'
}]
},{
id: 'rad',
width: 300,
allowBlank: false,
xtype: 'radiogroup',
msgTarget: 'side',
items: [{
boxLabel: 'Bar'
}]
}]
});
Ext.getCmp('rad').validate();
});

evant
30 Jun 2010, 4:05 AM
Translations for check/radio groups have been updated in SVN.