dizietemblesssma Posted February 9, 2022 Share Posted February 9, 2022 In Skyrim you can provide translation files for your MCM menu with your mod. I cannot find a way to do something similar with the Fallout4 MCM, is this not a thing? diziet Link to comment Share on other sites More sharing options...
KyleSimmons Posted February 10, 2022 Share Posted February 10, 2022 You can by using $someKey instead of the actual text in your config.json and then providing FO4\Data\Interface\Translations\modName_language.txt files with the text for each language as $someKey[TAB]translated text. Example: .../Data/MCM/Config/MyInternationalMod/config.json { "modName": "MyInternationalMod", "displayName": "My International Mod", "minMcmVersion": 1, "content": [ { "type": "section", "text": "$generalSettings" }, { "id": "bIsEnabled:general", "text": "$isEnabled", "type": "switcher", "help": "$isEnabled_help", "valueOptions": { "sourceType": "ModSettingBool" } } ] } .../Data/Interface/Translations/MyInternationalMod_en.TXT $generalSettings General Settings $isEnabled Enable My International Mod $isEnabled_help Turn this off to disable My International Mod Key and value are separated with a tab. Link to comment Share on other sites More sharing options...
dizietemblesssma Posted February 10, 2022 Author Share Posted February 10, 2022 Thankyou for this:) diziet Link to comment Share on other sites More sharing options...
dizietemblesssma Posted February 10, 2022 Author Share Posted February 10, 2022 Ok, I've done this - exactly the same as in Skyrim. But it is not working:(Could I be missing something else? diziet Link to comment Share on other sites More sharing options...
KyleSimmons Posted February 11, 2022 Share Posted February 11, 2022 Make sure the txt file has the right encoding. Needs to be UTF-16 Little Endian. You can check the f4se.log file (My Documents/My Games/Fallout 4/F4SE/f4se.log) and look for the "Reading translations" lines. If your file has incorrect encoding it will complain about BOM and encoding. Link to comment Share on other sites More sharing options...
dizietemblesssma Posted February 12, 2022 Author Share Posted February 12, 2022 Oh fudge! The encoding! I forgot that I had to do that in Skyrim. Maybe I should make some notes:)Thankyou. diziet Link to comment Share on other sites More sharing options...
dizietemblesssma Posted February 12, 2022 Author Share Posted February 12, 2022 Ok, it's working now except for text in between html mark up, if I have e.g.:"text": "<p>$warning</p>",and:$warning If you uninstall this mod the 'AllowAttacks' properties will stay at whatever value you last set them to.then the menu displays:$warning but if I put the tags in the tokenised text:$warning <p>If you uninstall this mod the 'AllowAttacks' properties will stay at whatever value you last set them to.</p>and:"text": "$warning",in the config.jsonthen the menu displays:<p>If you uninstall this mod the 'AllowAttacks' properties will stay at whatever value you last set them to.</p> is there a way to get this working? diziet Link to comment Share on other sites More sharing options...
KyleSimmons Posted February 13, 2022 Share Posted February 13, 2022 I don't know anything about Flash / ActionScript, but after having a quick look at MCM's source code, I'm not sure that the translation is done by MCM itself. MCM even uses a "Translator" helper function in more complex strings that need translated text. And that function basically sets the given string as the text property of a hidden TextField and then just immediately returns the text property of that hidden TextField. Seems to me that the translation / text replacement is happening somewhere else. So what I suspect is happening when combining HTML and translations is this (total guesswork!): In the second case (HTML tags in translation file) the text is added as htmlText, since there are no tags this comes out pretty much as plain text. The "$" is recognized by whatever does the translating and the text gets replaced with the text from the translation file. But I suspect that the translation process adds it as text, not as htmlText. Comparing this to JavaScript's (both languages are based on ECMA) "textContent" (=text) and "innerHTML" (=htmlText) this would mean that after the translation the htmlText look something like this: "<p>If you uninstall this mod the 'AllowAttacks' properties...</p>".Ok, I just tested this in a barebones Flash project. And setting a text box's "text" property to "<p>If you uninstall</p>" actually ends up with its htmlText property as "<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#0066CC" LETTERSPACING="0" KERNING="0"><p>If you uninstall</p></FONT></P></TEXTFORMAT>". A lot of extra HTML added to it and the tags' angle brackets get escaped as expected. Not quite sure what to make of the first case ("<p>$warning</p>"). If the text is added as htmlText and properly parsed, then the resulting value of the text property should be "$warning" and the first character should be "$" which seemingly should trigger the translation. Testing this in the same Flash project as before confirms this. Maybe whatever does the translation doesn't just look at the first character of the text property after all...The resulting htmlText in my test project is actually identical for both setting htmlText to "<p>$warning</p>" and setting htmlText to "$warning". Could be that it's just looking at the raw incoming text (whether set via htmlText or text) directly to apply translations. Maybe neanka knows more about this, or someone who worked on the Skyrim MCM. BTW, did translations with HTML tags work in Skyrim MCM? Link to comment Share on other sites More sharing options...
dizietemblesssma Posted February 14, 2022 Author Share Posted February 14, 2022 The skyrim mcm doesn't have a config.json, all text etc. is done by a script, so I don't think html text would apply - I never came across it:)I shall copy my post here to the F4 MCM github asn an issue, see what happens.Thanks diziet Link to comment Share on other sites More sharing options...
Recommended Posts