Unplanned
Last Updated: 28 Apr 2023 09:05 by ADMIN
Carlos
Created on: 28 Apr 2023 08:22
Category: Chat
Type: Feature Request
0
RadChat: CurrentCulture should be considered in the ChatCalendarOverlay

Use this code:

        public RadForm1()
        {
            InitializeComponent(); 
            System.Threading.Thread.CurrentThread.CurrentCulture = culture;
            System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

            this.radChat1.Author = new Author(Properties.Resources.bot, "Nancy");

            Author author2 = new Author(Properties.Resources.bot, "Andrew");
            ChatTextMessage message1 = new ChatTextMessage("Hello", author2, DateTime.Now.AddHours(1));
            this.radChat1.AddMessage(message1);
            ChatTextMessage message2 = new ChatTextMessage("Hi", this.radChat1.Author, DateTime.Now.AddHours(1).AddMinutes(10));
            this.radChat1.AddMessage(message2);
            ChatTextMessage message3 = new ChatTextMessage("We would like to announce that in the R2 2018 release " +
                                                           "we introduced Conversational UI", author2, DateTime.Now.AddHours(3));
            this.radChat1.AddMessage(message3);
            ChatTextMessage message4 = new ChatTextMessage("This control provides rich conversational experience " +
                                                           "that goes beyond the natural language understanding and " +
                                                           "personality of your chatbot.", author2, DateTime.Now.AddHours(3));
            this.radChat1.AddMessage(message4);

            calendarOverlay = new ChatCalendarOverlay("Select a date");
            Author author = new Author(Properties.Resources.bot, "Andrew");
            ChatOverlayMessage overlayMessage = new ChatOverlayMessage(calendarOverlay, author, DateTime.Now);        
            this.radChat1.AddMessage(overlayMessage);
        }

You will notice that the footer doesn't show the date formatted in Spanish:

1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 28 Apr 2023 09:05

Hello, Carlos,

Thank you for bringing this to our attention. We will do our best to improve the RadChat's experience.

Currently, the possible solution that I can suggest is to use the following approach:

        public RadForm1()
        {
            InitializeComponent(); 
            System.Threading.Thread.CurrentThread.CurrentCulture = culture;
            System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

            this.radChat1.Author = new Author(Properties.Resources.bot, "Nancy"); 

            Author author2 = new Author(Properties.Resources.bot, "Andrew");
            ChatTextMessage message1 = new ChatTextMessage("Hello", author2, DateTime.Now.AddHours(1));
            this.radChat1.AddMessage(message1);
            ChatTextMessage message2 = new ChatTextMessage("Hi", this.radChat1.Author, DateTime.Now.AddHours(1).AddMinutes(10));
            this.radChat1.AddMessage(message2);
            ChatTextMessage message3 = new ChatTextMessage("We would like to announce that in the R2 2018 release " +
                                                           "we introduced Conversational UI", author2, DateTime.Now.AddHours(3));
            this.radChat1.AddMessage(message3);
            ChatTextMessage message4 = new ChatTextMessage("This control provides rich conversational experience " +
                                                           "that goes beyond the natural language understanding and " +
                                                           "personality of your chatbot.", author2, DateTime.Now.AddHours(3));
            this.radChat1.AddMessage(message4);

            calendarOverlay = new ChatCalendarOverlay("Select a date");
            Author author = new Author(Properties.Resources.bot, "Andrew");
            overlayMessage = new ChatOverlayMessage(calendarOverlay, author, DateTime.Now);  
            this.radChat1.AddMessage(overlayMessage);

            LightVisualElement footerElement = ((LightVisualElement)overlayMessage.OverlayElement.Children[0].Children[2]);
            footerElement.TextChanged += footerElement_TextChanged;
        }

        private void footerElement_TextChanged(object sender, EventArgs e)
        {
            LightVisualElement footerElement = sender as LightVisualElement;
            footerElement.TextChanged -= footerElement_TextChanged;
            footerElement.Text = calendarOverlay.Calendar.SelectedDate.ToString("dd-MMMM-yyyy", culture);
            footerElement.TextChanged += footerElement_TextChanged;
        }

        ChatCalendarOverlay calendarOverlay;
        ChatOverlayMessage overlayMessage;
        CultureInfo culture = new CultureInfo("es-ES");

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.