it seems there is a problem with the localization manager for DateTimePicker, in case of a wrong date:
When the control is loaded, it asks for the text to display with the "Error" name.
When the error occurs, it is asking again for the same text, but the key now is the value returned from the first call!
1. the control asks for the text to display "Error", the application returns "Erreur" (in French).
2. in case of error, the control asks for the text to display "Erreur".
5 Answers, 1 is accepted
We are not exactly sure that we completely understand your scenario and issue. We tested the localization of RadDateTimePicker using the LocalizationManager and it seems everything is working as expected on our side. Please, check the attached video that demonstrates that and let us know if we didn't miss something.
Could you please, try to isolate the issue in a sample project and send it to us - thus we could be able to continue our investigation?
We are looking forward to hearing from you.
thanks for your answer.
It works in your video because this is not the right text: only the text Error, when you enter a bad date, has the problem...
Tell me if you need more information.
This is due to the implementation of the control. The property default value is the key for the localized string and the localized string is being set to the same property afterwards. However for the later calls if the string is not found the value of the property won't be changed - it will remain with the localized string. If you need to support different cultures you would need to reapply the ControlTemplate of the control in order to reset the ErrorTooltipContent property with the current culture string.
Hope this helps.
thanks for the explanation.
The problem is that the Telerik documentation doesn't list all the resource keys that are needed for a control. For example, the documentation for RadDateTimePicker doesn't list the "Today" key that is new to version Q1 2016. For RadRibbonView, the keys are not displayed and the example lists only 3 of the 12 (at least keys) So to detect the missing keys, I display them inside square brackets. Now, with your implementation of this particular resource, the translated string is displayed between square bracket.
Now for the control implementation.
First, note that the problem is only with the "Error" key and that the other messages are handled correctly. In addition, the translated string is always displayed with a single pair of square brackets, so the call is only made twice, not for each display of thie text.
Second, it should not be difficult to have a field that is initialized to null when the resource is not known and that is initialized with the key in this case.
Now for the LocalizationManager.
The only documentation published by Telerik says that it should receive a key and that it should return the text to display for the key.
It doesn't specify that, when the key is not found, we should return the key.
All this to say that the problem is from the implementation of this particular resource key for the RadDateTime control.
Have a good day
I would like to thank you for your feedback - we will add the new key to the DateTimePicker documentation and will consider updating the RibbonView documentation in order to explain all the existing keys.
As for the Error string - it is calling the LocalizationManager each time the ErrorToolTip is displayed. It works the explained way due to the control implementation - it uses single property to store the initial key and the set value of the ErrorToolTipContent. Regarding the LocalizationManager - it should be used as explained in the article, this is just specific case with the implementation of the control.
Hope this helps. I have also updated your Telerik points for your feedback.