I found a not expected behavior in the localization mechanism.
For clarity, I will try to explain the problem with an example:
- I insert a TextEdit in a blank form
- Set Localizable form property to true
- Change the language form property to English (our default locale is Italian)
- Save
- Change the language form property to default
- Now in the en resx there are some properties of the TextEdit mask (but I didn’t make changes at mask in English). This is the unwanted behaviour.
- Set the mask of TexEdit to “Numeric n2” and UseMaskAsDisplayFormat to true
- I run the application in English and the Numeric mask is not active, running the app in Italian changes made to mask take effect
The problem is that I have different behavior for each language but mask and UseMaskAsDisplayFormat should not persist in english resx, since I need them to be language independent.
Suppose to change UseMaskAsDisplayFormat before changing Language property, I have same behavior for English and Italian.
When I Just switch language to English and back to default (Italian) from there I get a separate way behavior.
This does not happen with native windows forms controls.
Thanks
Roberto
Hello Roberto,
I see the behavior you are talking about. I reviewed our code and found that the EditMask property is marked with the DefaultValue("") attribute, which means that this value should not be stored in the .resx file.
I'll pass this ticket to our developers for further research.
For now, I suggest that you create a custom TextEdit descendant and mark the EditMask with the Localizable(false) attribute:
<Localizable(False)> Public Overrides Property EditMask() As String Get Return MyBase.EditMask End Get Set(ByVal value As String) MyBase.EditMask = value End Set End Property
Attached is a small sample that demonstrates this approach.
What about UseMaskAsDisplayFormat property which is described in the ticket also?
There are many other mask properties that have the same problem, for example: AutoComplete, BeepOnError, MaskType …
The same goes for many properties of Appearance object, for example: SimpleButton.Appearance.Image and NavBargroup.Appearance.Image
And also Properties.AccessibleName, Properties.AccessibleDescription,…
Can you please check if there are other control affected by this bug?
Thanks
Roberto
Hello Robert,
What about UseMaskAsDisplayFormat property which is described in the ticket also?
You can also make it non-localizable in a similar manner:
<Localizable(false)> _ Public Overrides Property UseMaskAsDisplayFormat As Boolean Get Return MyBase.UseMaskAsDisplayFormat End Get Set MyBase.UseMaskAsDisplayFormat = value End Set End Property
There are many other mask properties that have the same problem, for example: AutoComplete, BeepOnError, MaskType …
The same goes for many properties of Appearance object, for example: SimpleButton.Appearance.Image and NavBargroup.Appearance.Image
And also Properties.AccessibleName, Properties.AccessibleDescription,…
I see this behavior. However, as I stated earlier, we use the standard DefaultValue attribute. We will research ways to improve this behavior and let you know our results.
Hi Sasha,
did you find a solution for this issue?
Please let us know, thank you.
Hello Paolo,
Our developers are researching this behavior. We will update this thread as soon as we make any progress.