• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Map string translation of multiple maps

Status
Not open for further replies.
Hey,
imagine you have multiple maps: A.w3x and B.w3x.
You take the "war3map.wts" file from A.w3x and translate it into German and call it "war3map_de.wts".

Now you have translated A.w3x into German but B.w3x is still not translated.

A.w3x and B.w3x share the same object data so maybe 90% of the strings are the same.

Therefore a tool might be useful which now takes your "war3map.wts" file from A.w3x and the "war3map_de.wts" file and extracts the "war3map.wts" file from B.w3x. Now the tool checks which strings were translated into German with which translations for A.w3x.
It basically builds a map with the untranslated strings as keys and the translations as values.

For every string from B.w3x which does also exist in A.w3x it uses the translation from "war3map_de.wts" and generates an output file. For every string which does not exist in A.w3x it simply uses the untranslated string from B.w3x.

This should reduce the strings a user has to translate if many strings are shared.

I have written such a tool using wc3lib called "wc3trans" which does only support using war3map.wts input files at the moment.. I guess it might be only interesting if you have a campaign or many maps with the same object data.

What do you think of the idea? For me it sounds like a simple merge by using three files instead of two. Would there be any easier way to achieve this? I just have this problem since I have many many custom objects shared by 5 maps.
The tool could also support an unlimited amount of input files instead of only one for a map like B.w3x.

Currently you have to call:
Code:
wc3trans war3map.wts war3map_de.wts war3map_of_B.wts out.wts
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
This would not really be injective, multiple strings could have the same content and you do not know their context, whether they really should be translated by XYZ. You should rather tie them by their creation process, like have one routine that provides the units with their respective strings and translations, then distribute it to the maps that need them.
 
For my maps I can't think of any string which should not be translated with the same translation if it is the same string. I could limit it to object data strings or exclude specific strings but extracting all unit strings etc. if you don't create all object data automatically from a script is much more complicated than writing this little tool. Besides the ObjectMerger is still bugged for German strings.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
How do you know if the object in one map corresponds to the object in another map? The campaign editor offers the shared object editor, which enforces equal ids but you just have multiple maps. Maybe it would have been an idea to develop it as a campaign and make the compiler split it into single maps.
 
Because my maps share the EXACT SAME object data like a campaign. I don't use a campaign since the maps should be playable in multiplayer. Another safer approach might be that to check in the string comment for the object ID but usually the same translation could be used anyway.

I don't know how a campaign works here. Does the campaign use its own war3map.wts file and merges it with the one of the maps. If so still every map has its own big war3map.wts file with all the shared strings my tool is still useful. Otherwise it is only for multiple multiplayer maps with the same object data or somebody who thinks that the translations from one map might be good enough for another map.

edit:
I looked into https://wc3lib.org/spec/InsideTheW3M.html and there is no sign of a war3map.wts file specifically for campaigns so every chapter in a campaign has its own war3map.wts file generated. Therefore even for campaigns my tool is very useful. You have to translate one map only and can merge most of the translations to the other maps.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Yeah I meant if there is some definite key since if you use the same object, it's not farfetched that there would be some serialization stuff going on or that you need to tie them for another purposes. I know that you require multiple maps and was just arguing it could be beneficial for development time. Even if there is no combined .wts in the .w3f, the object definitions are and those can be introspected to see the link to the .wts entries.
 
Status
Not open for further replies.
Top