Jump to content

Plugin Globalization


Recommended Posts

Ok, now i made my first plugin with buildin english language an created a resource for german translation.

Now the problem i'm facing is, the CurrentUICulture is inconsistent between callbacks.

 

While in the Constructor, OnCreatePropertyCollection & OnCreateConfigUI, the CurrentUICulture is set as the language i selected in PDN, in the OnSetRenderInfo, the CurrentUICulture is set to my operating system settings.

 

The consequences with an example:

  • The plugin has:
    • Buildin english language.
    • External resource dll for german language.
  • Operating system regional settings: German
  • PDN Language settings: English
  • The problem:
    • The constructor uses Properties.Resources with the CurrentUICulure set by PDN(English in this case, resource lookups will choose buildin resources which are in enlgish)
    • In OnCreatePropertyCollection properties are created with the names from Properties.Resources.
    • In OnCreateConfigUI, everything is fine since the CurrentUICulture is still the one set by PDN.
    • In OnSetRenderInfo i want to retrive the properties created in OnCreatePropertyCollection. But for this thread, the CurrentUICulture is set to my operating system regional settings(in this case german). This leads me to a NullPointerException, because the PropertyCollection which is passed to OnSetRenderInfo was created with names in english language, and now i try to retrive the properties by german name which do not exist.

Workaround: Set the Culture of your resource to System.Globalization.CultureInfo.CurrentUICulture in your effect plugin constructor.

Fix: PDN must set the CurrentUICulture of the curren thread to it's own setting.

Edited by HorridoJoho
Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...