Jump to content

How to localise names of custom controls in MCM?


Recommended Posts

Hello, everyone!

 

I was looking for a way to extend the localisation thing by SKSE and SkyUI to the names of custom controls. I know how to do the localisation thing, or at least the basics of it, and I did manage to achieve localised notifications using the ShowNotification from SkyUILib. But I have not yet found a way to translate the names of custom controls when MCM reports them as conflicting. It would be fantastic to have the control name included in the localisation system for easy translation, as everything else in the mod, excluding the mod name, can currently be translated by modifying the appropriate localisation file.

 

The thing is that if the contents of the text field must be an exact match to the key in the localisation file, how would I do it? If the whole thing is like the example in GitHub (cannot remember it exactly):

"This key is already mapped to \n\""+ControlName+"\"\n("+ModName+")\nAre you sure blablabla?"
Which turns to something like

This key is already mapped to "ControlName" (ModName) Are you sure blablabla?
What do I put in the translation key? Does SkyUI automatically translate everything else other than the control name if everything else other than the control name is an exact copy of the example on GitHub? Because the control name is always different and there is no {} or $ in the example, I am not even sure of that is the case. Is it?

 

I know this

"$BlaBlaBla_{"+SomeInt+"}_MoreBla"
With this in localisation file

$BlaBlaBla_{}_MoreBla I have {} brain cells!
Would display this

I have 2 brain cells!
But how would the custom control work? It is in the middle of the string thingy. I could modify MY conflict reporting string, but for others, it would still display something else. Would it?

 

I currently have this as the control 'name'

$_PP_RR_MCMCustomControl
And this in the localisation file

$_PP_RR_MCMCustomControl Reload Crossbow
And the reporting part in MCM is a copy of the GitHub example, so it will just show:

This key is already mapped to "$_PP_RR_MCMCustomControl" (Reasonable Reloading) Are you sure blablabla...?
How would I translate the name so that it would work for every person, with every custom MCM menu out there, so that it could be translated using the localisation files in ...Interface\Translations\ folder (or similar, cannot remember at the moment)? Putting it in a property would make it easy, but I want the mod to support full translation through the localisation files, without the need to modify .esp or scripts. So that people who translate it (if there will ever be any) could just translate and redistribute the localisation file and nothing else.

 

Thank you for any help you can offer. :)

 

Edit: Apologies for the formatting. Corrected it a bit, I hope. Unless the text in those code boxes looks even less clear.

Edited by PhilippePetain
Link to comment
Share on other sites

I think I solved it. I put this as the key in the script:

$_PP_RR_MCMCustomControl}{

And this in the localisation file:

$_PP_RR_MCMCustomControl}{ }Reload Crossbow{

And it now seems (not tested too extensively) to correctly substitute the relevant part in the middle of a string. In case anyone is interested. Which I doubt, though, as interest in the subject was not too great, it seems. :tongue:

 

Edit: Edited to make it more tidy.

Edited by PhilippePetain
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...