Localization strings

Answered
0
0

Hi.

Some of the localizable strings are documented here: https://docs.wisej.com/docs/concepts/localization
However, some messages, the session timeout for example (picture attached), will be localized to the built in localization resources embedded in Wisej already, but I would like to have my own localization resources for pt-BR. Would it be possible to have a list of the strings to be added to the custom resources to be localized?

Thanks in advance.

Ivan

Attachment
  • You must to post comments
Best Answer
0
0

Hi Ivan, you are right. We’ll change to protected. You can get around it by attaching the Load event and:

 this.Controls["buttonOK"].Text = "Test";

The control names are visible in the designer: buttonOK, messageText, expiredText. The {0} placeholder is replaced with the countdown.

Then you can use your form like this:

 private static void Application_SessionTimeout(object sender, System.ComponentModel.HandledEventArgs e)
 {
   e.Handled = true;

   // show the session timeout form only once.
   if (Application.OpenForms["Window1"] == null)
   {
     new Window1().Show();
   }
 }

In the same way you can build a completely custom form.

To test it, without having to wait for the timeout, use this in the chrome console:

  Wisej.Core.fireSessionTimeout();

You may have to do it twice.

 

  • Ivan Borges
    Worked really well, Luca, thanks! Once you change the controls into Protected, please let me know, I would like to create some responsive profiles to this form. Cheers.
  • You must to post comments
Great Answer
0
0

Hi Ivan,

For the session timeout text, you can extend it by adding an Inherited Control > SessionTimeoutForm.

Using this, you can customize the appearance and text of the popup box and apply any resource you want to it.

The way it is setup right now is the SessionTimeoutForm has it’s own resource file (SessionTimeoutForm.resx) that it reads the values from. There is no entry in Resources.resx.

 

If you’d like to see all the resource names available, you can use the System.Resources.ResxReader class:

https://docs.microsoft.com/en-us/dotnet/framework/resources/working-with-resx-files-programmatically

There is an example on how to enumerate over all the resources in a file here.

 

I will also make a special note to update our new documentation to include important resource names and a step-by-step guide how to override the Session timeout dialog or something similar.

 

Please let me know if you have any more questions!

 

HTH,

Levie

 

  • You must to post comments
0
0

Brilliant, Luca!

Thank you very much.

  • You must to post comments
0
0

Hi Levie.

Thanks for the prompt reply!

I followed your advice and added a SessionTimeoutForm inherited control. However, it looks like all objects in it are Private and therefore I am not able to change any of their properties.
I have a feeling I am missing something… 🙂

Any tip would be appreciated.

Cheers.

Ivan

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.