METALmurderer Posted December 1, 2018 Share Posted December 1, 2018 Has anyone figured a way to update localization.txt with xpath? As is I was planning on including and UpdateLocalization.txt and an UpdateQuest.txt with brief instructions to copy paste the stuff below the instructions to the end of the respective Localization files, unless there's a better way Thanks Link to comment Share on other sites More sharing options...
Ricowan Posted December 1, 2018 Share Posted December 1, 2018 Nope, xpath only works with XML. We just have to hope TFP converts localization to XML. Link to comment Share on other sites More sharing options...
Guppycur Posted December 1, 2018 Share Posted December 1, 2018 I will recommend loading localization as a csv in Excel though, for readability. Link to comment Share on other sites More sharing options...
Baobab Posted December 1, 2018 Share Posted December 1, 2018 Damn, all copy and paste. Grr, xml where fine. Link to comment Share on other sites More sharing options...
Arop Retim Posted December 1, 2018 Share Posted December 1, 2018 Extending Localization.txt for Mods possible? With XPath you can now edit the .xml entries remotely from the Mods dir. That's a really cool feature. But is there a way to edit/extend the Localization.txt without touching the original one in Data/Config? I tried simply adding a Localization.txt with only the additional entries inside the Mods/My_Mod/Config dir, but that didn't work. Link to comment Share on other sites More sharing options...
Ricowan Posted December 1, 2018 Share Posted December 1, 2018 No, it's not currently possible to edit txt files with a modlet. Link to comment Share on other sites More sharing options...
Death2gnomes Posted December 2, 2018 Share Posted December 2, 2018 If things like progression.xml descriptions had priority over Localization.txt we wouldnt need to change the local file at all. Link to comment Share on other sites More sharing options...
Arop Retim Posted December 2, 2018 Share Posted December 2, 2018 How did my post get here? Of course it's not possible with xpath. That was not my question... Localization as xml would be too much unnecessary stuff. The file would just bloat to dozens or hundrets of MB. The game would just need to look in the Mod folders for Localization.txt and Localization - Quest.txt and read them like the original ones. @Death2gnomes: Do I understand you right? Instead of a key for the Localization.txt you want to insert the description itself into the xml file? That would be really bad for all these guys who want to play in their native language. Link to comment Share on other sites More sharing options...
METALmurderer Posted December 2, 2018 Author Share Posted December 2, 2018 [ATTACH=CONFIG]25954[/ATTACH] If things like progression.xml descriptions had priority over Localization.txt we wouldnt need to change the local file at all. I don't think that's possible. Pretty sure the <property name="DescriptionKey" value="[anyItemDesc]"/> queries the Localization.txt in how the command runs, and TFP haven't given us enough access to write our own properties and classes to do this a different way With XPath you can now edit the .xml entries remotely from the Mods dir. That's a really cool feature. But is there a way to edit/extend the Localization.txt without touching the original one in Data/Config? I tried simply adding a Localization.txt with only the additional entries inside the Mods/My_Mod/Config dir, but that didn't work. We asked essentially the same question with different words, I guess a moderator merged your thread with mine because they cover the same idea Link to comment Share on other sites More sharing options...
sphereii Posted December 2, 2018 Share Posted December 2, 2018 Localization from the Mods folder may happen in A17.*, or possibly A18. With Quests, ,you can use the desc_key, I think, to sneak in a hard-coded, non-localized value. However, I think that's the only spot that can be done. Doing the same in your blocks or items code has no effect. Link to comment Share on other sites More sharing options...
Arop Retim Posted December 2, 2018 Share Posted December 2, 2018 WHAT?!? A17.* or A18? Xpath Mods will be useless without this feature. Let's say I make 4 Mods (More Food, More Tools, More Vehicles, More Decoration). Do I really have to provide 15 different Localization files (one for each possible combination)? And adding mods from another modder will be a totally pain for every user. And this is what xpath was created for. Please add this feature asap. Link to comment Share on other sites More sharing options...
sphereii Posted December 2, 2018 Share Posted December 2, 2018 WHAT?!? A17.* or A18? Xpath Mods will be useless without this feature. Let's say I make 4 Mods (More Food, More Tools, More Vehicles, More Decoration). Do I really have to provide 15 different Localization files (one for each possible combination)? And adding mods from another modder will be a totally pain for every user. And this is what xpath was created for. Please add this feature asap. You wouldn't provide any localization with your modlets until the hooks were included, and we know what format we need to design them with. Link to comment Share on other sites More sharing options...
Arop Retim Posted December 2, 2018 Share Posted December 2, 2018 Well... without localization the item names and descriptions will cause brain damage on "normal" players. And nobody wants to wait until A18 to get that fixed. Link to comment Share on other sites More sharing options...
sphereii Posted December 2, 2018 Share Posted December 2, 2018 Well... without localization the item names and descriptions will cause brain damage on "normal" players. And nobody wants to wait until A18 to get that fixed. oh okay. Link to comment Share on other sites More sharing options...
doughphunghus Posted February 23, 2019 Share Posted February 23, 2019 Is there a "preferred way" of dealing with adding entries to localization.txt when creating mods/modlets? I've seen some posts referring to creating a batch file the user would run (to append to localization.txt), but there seems to be no standard way to tell mod makers how they need to address it so people installing mods all use the same install process. Link to comment Share on other sites More sharing options...
stasis78 Posted February 24, 2019 Share Posted February 24, 2019 It’s an easy problem to solve. The hard problem is getting modders to use the same loc tool. I don’t know of any dedi providers that let you run bat or exe so that has to be done manually anyway. Link to comment Share on other sites More sharing options...
doughphunghus Posted March 16, 2019 Share Posted March 16, 2019 Maybe if *something* existed modders would use it...? For providers (I'm assuming you mean people who run servers who don't have full control of the server?) the scriptable solution would be to put all the mods in a folder you control and can run scripts against, generate the Localization.txt file, then copy it over manually to the server. Ugh but the worse problem I believe is getting modders to put their localization's in a separate file so at least it can be easily manually added and/or scripted against. For my own mods I'm working on I created a script that can "merge" Localization data in mods into the master Localization.txt file. There are many caveats but it's a "brute force" script that appears to get the job done. Anyone interested? It will need more work before it's "easy to use", but it may provide a common tool for mod developers to handle the Localization issue until it's handled in the core game. It *does* make some hopefully superficial changes to the core Localization.txt file, so I'm not sure yet if the changes matter, esp. since there's a lot of odd characters and things in it. Notes: 1. Inside the mod folder (e.g. Mods/<mod name>), there must be a Localization.txt file. The csv format of this file is identical to the game Localization.txt file 2. The script is written in perl, so Windows users may need to install it (recommend ActiveState Perl), Linux will likely have it installed. Not sure about Macs 3. It was written on Linux, so it's possible there may be some issues on Windows with file paths (it *should* work, I haven't tested it) 4. You have to install 1 perl module from CPAN (Text::CSV). On windows this involves knowing how to run PPM to install the module. On Linux it may involve knowing how to install it so it doesn't install in the root perl. I'm likely going to try to bundle the module with the script to get around all of this. 5. In theory, because it will merge changes to a localization entry not just add new entries, with the script you could create a "mod" that was only a Localization.txt file to "fill in" missing localization values in the core Localization.txt file OR completely change the localization.txt values that already exist. 6. In theory you can make the same types of changes to mod the "Localization - Quest.txt" file, but the script would need some more changes. Link to comment Share on other sites More sharing options...
DiscipleOfBryan Posted January 5, 2020 Share Posted January 5, 2020 Nope, xpath only works with XML. We just have to hope TFP converts localization to XML. This absolutely needs to happen, alongside the ability to have players auto-download custom icons from a server, if modding is ever going to be truly serious for this game. Link to comment Share on other sites More sharing options...
turbero Posted January 5, 2020 Share Posted January 5, 2020 Trial and Error always leads you to an unexpected success This is happening already. I just managed after trial and error. 1) Create the file Config\Localization.txt under your modlet folder 2) THIS LINE MUST GO FIRST: Key,UsedInMainMenu,Source,Context,Changes,English,French,German,Klingon,Spanish,Polish 3) Add your entries with at least key,Source,Context,Changes and English translate You can find examples for all the values in the vanilla Localization.txt file (i.e. Changes = newKey always) Example: Key,UsedInMainMenu,Source,Context,Changes,English,French,German,Klingon,Spanish,Polish my_key_1,,Quest,Quest Info,newKey,English Value For My First key,,,,, my_key_2,,Quest,Quest Info,newKey,English Value For My Second key,,,,, Link to comment Share on other sites More sharing options...
sphereii Posted January 5, 2020 Share Posted January 5, 2020 Yes, this was a thing in A18.2. The absolute minimum you need is Key,English; the game will just blank out the rest of the missing issue. You do need to maintain that your header matches your other values in the file. If a non-english language is selected, it'll use the English column. if the English column isn't provided, and English is the chosen language, then it'll display the Key Link to comment Share on other sites More sharing options...
alphaniner Posted March 4, 2020 Share Posted March 4, 2020 Yes, this was a thing in A18.2. The absolute minimum you need is Key,English; the game will just blank out the rest of the missing issue. You do need to maintain that your header matches your other values in the file. If a non-english language is selected, it'll use the English column. if the English column isn't provided, and English is the chosen language, then it'll display the Key Thanks for this. IMO this info deserves a stickied thread here or in Tutorials and Guides. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.