• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

WIP Spanish translation

So I'd be inclined to copy the "QUEST_MESSAGE" lines into "common.ini", then anywhere you find them being used, add in 'XI_ConvertString', e.g.:
I tried that with QUEST_MESSAGE7 "Captain, we've encountered the Black Pearl!" because I had a save to test it and it didn't work, the string didn't show up at all. Looking at the stock game, it uses 'GlobalStringConvert' for these lines. I don't know if that's still a thing in NH, but not harm in trying.

Yay, that works! And no need to add the lines to common.ini after all. Actually, I'm pretty sure 'XI_ConvertString' would have worked too, I just forgot to put "QUEST_MESSAGE7" in quotes and that's what made 'GlobalStringConvert' work.

I'll add 'GlobalStringConvert' to all QUEST_MESSAGE strings (unless it was removed in the first place for a reason)
 
Last edited:
Attached are:
PROGRAM \QUESTS\quests_side.c and quests_common.c
PROGRAM\Storyline\standard\quests\ quest reaction.c and both_reaction.c

And an slightly ammended Spanish globlas.txt (ast we can now play TOASH as Danielle I replaced "Danielle is dead" with "Your companion is dead" among others)

EDIT:reuploaded both_reaction.c because of an extra bracket.
 

Attachments

  • quests_common.c
    278.9 KB · Views: 79
  • quests_side.c
    753.2 KB · Views: 64
  • quests_reaction.c
    363.1 KB · Views: 56
  • both_reaction.c
    144.2 KB · Views: 62
Last edited:
Try this version. As well as "Bullen Bay", it also has "Boca de Yuman." and "Boca de Hubon." - the file already had "Boca de Yuman" and "Boca de Hubon" but some versions of the string have the added full stops which prevented them from being translated.
Your version doesn't have the fix to the string "This officer can command ships up to class", it still says 'tier' instead of 'class', which doesn't match the c.file and thus the line doesn't get translated. This should have everything

EDIT: and added one more location: Smuggler's Home in Kralendijk
 

Attachments

  • interface_strings.txt
    140.9 KB · Views: 67
Last edited:
I'm consistently experiencing a CTD when playing in Spanish towards the end of the standard storyline, just after fleeing the temple and always at the exact same moment in the middle of the dialog with Clement: when I click to advance past DLG_TEXT[47], the game freezes and crashes
1685226733284.png
I don't think it can be the Spanish dialog files themselves because I replaced the whole standard\DIALOGS\SPANISH folder with the English one to check and still crashed, but when I switched to playing in English, it worked. There is no error log. Attached are the other log files and a save right before the temple collapses.

This time deleting the options file didn't help.
 

Attachments

  • compile.log
    3.5 KB · Views: 62
  • system.log
    474 bytes · Views: 61
  • -=Player=- QuickSave.zip
    1 MB · Views: 68
Last edited:
I keep thinking and can't find an explanation. I remember excessively long dialog lines causing crashes, but that's not the case here, as replacing all dialog files with the English versions didn't stop the crash, so that should rule out the dialog files. The lines before and after the crash are just plain text, no fancy variables, so there should be no difference there between English and Spanish. Is there something else supposed to trigger at that moment? A questbook update?

I haven't fully played this storyline in the mod before, so I don't know if the crash is related to any new additions or to something that's been there for years but nobody found before.
 
Last edited:
First, unless I've missed a file from you, Spanish "researcher_dialog.h" does have a mistake. The one I got from "SPAfile May24.zip" has a missing quote mark at the start of line 124:
Code:
¿Y qué hay del tesoro?",
The attached version has it. After I had found that, I was able to look into your problem.

Your savegame works if I load it after starting the game in English or Russian. It crashes only if I start in Spanish. So the problem is in the Spanish translation. The problem with "researcher_dialog.h" isn't responsible; until I'd fixed that, Clement only gave a blank dialog in the temple and I didn't even get to the beach. The problem is with questbook file "After_Final.txt". If I comment out the line 'AddQuestRecord("After_Final", 5);' in "researcher_dialog.c", the game does not crash. I tried replacing the text with the English version, and that worked. Swapping English and Spanish lines to see which line crashes the game narrowed it down to line "text.t1". Chopping off and putting back parts of that line showed that it wasn't a problem with a preprocessed variable missing either the "#s" at the start or the "#" at the end, because the file worked with all of them in place. It turns out that the game does not like excessively long questbook lines. You will need to rephrase this line to something shorter:
Code:
text.t1=Bueno, la gran batalla ha acabado y hemos derrotado a la Perla Negra, lo que habría sido imposible de no ser por ese artefacto que encontró #sDanielle#. Me pregunto qué pensarán los ingleses de nosotros ahora. Ya deben de saber que Silehard los ha traicionado. Tal vez si poonemos rumbo a #sRedmond#, en #sisland_Redmond#, haya una recompensa esperándonos. Pero ningún diplomático será capaz de arreglar esto a no ser que entreguemos todo el botín que hemos ganado, ¡y no pienso hacer eso! Primero deberíamos devolver a Clement a su casa en el faro de #sisland_Oxbay#, y después zarpar hacia #sisland_Redmond#. Tendremos que entrar en la ciudad por la puerta trasera, atravesando por el interior desde la Costa Rocosa, por si acaso los ingleses todavía se muestran poco amables con nosotros. Pero tengo el presentimiento de que todo irá bien.

If I cut it down after "poco" in the second last sentence, the game does not crash. If I add in "amables", it does. That is therefore the maximum line length which the game tolerates. (It can't be the total size of the file. If it were, you wouldn't have got very far into the story because "After_Final.txt" is only 2KB in size, while several others are 5KB, including "Story_1stTaskReceived.txt".)

And then you have another problem, though nothing to do with coding or translation. You have a 3rd rate ship of the line with a lot of sail damage. Good luck getting that through the keyhole channel and into the open sea, let alone catching the Black Pearl. :D
 

Attachments

  • researcher_dialog.h
    10.5 KB · Views: 60
First, unless I've missed a file from you, Spanish "researcher_dialog.h" does have a mistake. The one I got from "SPAfile May24.zip" has a missing quote mark at the start of line 124:
Yes, I fixed that a couple days ago. I have a whole bunch of dialogs ready to go, I was only waiting for this crash business.

The problem is with questbook file "After_Final.txt". If I comment out the line 'AddQuestRecord("After_Final", 5);' in "researcher_dialog.c", the game does not crash. I tried replacing the text with the English version, and that worked.
I knew I was on to something with the questbook, but when I thought of it yesterday, I had just left home and couldn't check. I also was onto something with the excessively long lines, only not in dialogs. I just didn't put 2 and 2 together. Thanks!

Glad that's solved, I'll shorten that entry.
 
And then you have another problem, though nothing to do with coding or translation. You have a 3rd rate ship of the line with a lot of sail damage. Good luck getting that through the keyhole channel and into the open sea, let alone catching the Black Pearl. :D
You'd think that but apparently there's a bug that restores most of my sails HP if I hit the rocks with the bowsprit. I think the game gets confused because the sails condition is almost gone but the ship model gets its masts back on respawning, so losing the bowsprit resets the damage as if only the bowsprit had been damaged. I don't know if this is a known bug or not but it was quite fortunate in this occassion:p
1685469792339.png
 
It is a known bug. The stock game didn't have falling masts so they're not saved, which does indeed lead to masts being replaced and sails being completely repaired. You're still going to have an interesting time getting that lumbering beast out through the channel, and the Black Pearl is still a lot faster. I normally bring a frigate to this battle. ;)
 
A couple of lucky early broadsides with chainshot took down her main mast.

This should make Tales of a Sea Hawk fully translated, all dialogs from the rmain quest (and some other unrelated ones), both from the general and Storyline\standard folders have been translated/fixed, a couple of dialog.c files have had missing translation code added to preprocessors, the problematic questbook has been shortened and some others have had some typos fixed. Also includes the fixes for quests and characters files from the last few posts.

There's one last thing. In standrad\quests\quests_reaction there's this bit with the name of the sailor that warns you of the English fleet coming to take back Bridgetown
Code:
// KK -->
            if (CheckAttribute(PChar,"firstname"))
                Characters[GetCharacterIndex("Blaze_Crewmember_01")].name = pchar.firstname + "'s crewmember";
            else
                Characters[GetCharacterIndex("Blaze_Crewmember_01")].name = pchar.name + "'s crewmember";
What would be the best way to translate it, considering it needs a different word order (x's crewmember> marinero de x)? As it's a dynamic name that changes depending on the player's, I don't know if it could be added to characters_names with a preprocessor or something, or if it's better to just add a language switch right there? (and would that need to be two switches, one for the "if" and one for the "else"?)
 

Attachments

  • SPAfiles30may.zip
    613.6 KB · Views: 81
Last edited:
There's one last thing. In standrad\quests\quests_reaction there's this bit with the name of the sailor that warns you of the English fleet coming to take back Bridgetown
Code:
// KK -->
            if (CheckAttribute(PChar,"firstname"))
                Characters[GetCharacterIndex("Blaze_Crewmember_01")].name = pchar.firstname + "'s crewmember";
            else
                Characters[GetCharacterIndex("Blaze_Crewmember_01")].name = pchar.name + "'s crewmember";
What would be the best way to translate it, considering it needs a different word order (x's crewmember> marinero de x)? As it's a dynamic name that changes depending on the player's, I don't know if it could be added to characters_names with a preprocessor or something, or if it's better to just add a language switch right there? (and would that need to be two switches, one for the "if" and one for the "else"?)
For one thing, that whole condition is unnecessary because function 'GetMyName', defined in "PROGRAM\Dialog_func.c", does the same thing and also checks if the character has only a "lastname" attribute - which you will if you only chose to give yourself a single name such as "Blackbeard", as the game then changes your one name to be "lastname".

See if this version works. That whole section is commented out in case my replacement causes trouble and the original needs to be put back to at least get something working. My version looks like this:
Code:
            switch(LanguageGetLanguage())
            {
                case "SPANISH": Characters[GetCharacterIndex("Blaze_Crewmember_01")].name = TranslateString("","Crewmember of") + " " + GetMyName(PChar); break;
                Characters[GetCharacterIndex("Blaze_Crewmember_01")].name = GetMyName(PChar) + " " + TranslateString("","'s crewmember");
            }
This version of "quests_reaction.c" also contains a few other updates. A couple of places where videos are played now have switches to allow for Russian versions of those videos. And obsolete attempts to translate "his"/"her" by a gender-based condition are now replaced by calls on 'GetMyPronounPossessive'.

Also attached is Spanish "interface_strings.txt" with "Crewmember of" and "'s crewmember" in place waiting to be translated.

The player's name can't be added to "characters_names.txt" because you can't guarantee that the player will use either of the normal names. "Tales of a Sea Hawk" allows you full character customisation at the start - you can pick any character model you like and give yourself whatever name you prefer.

Edit: "quests_reaction.c" deleted because it was faulty. A new version is in a later post.
 

Attachments

  • interface_strings.txt
    140.9 KB · Views: 64
Last edited:
:onya

Here's the updated interface_strings, and some extra fixes and typos to dialogs (and translated preprocessor for Anacleto Rui). Also the crewmembers who receive you at San Juan when you rejoin them after the storm are always called "Nathaniel's crewmember" regardless of your name, because that one is handled through characters_names.txt, so I changed the translation to say the equivalent of "Member of your crew".
 

Attachments

  • SPAfiles31May.zip
    77.4 KB · Views: 66
I've just re-uploaded "quests_reaction.c" to my previous post. The code to assign the crewmember's name is now moved up to the end of case "Story_leavingOxbay" and applied to all three crewmembers. The translation in "characters_names.txt" doesn't do any harm because the characters are defined in general file "SideQuest.c", not in any storyline-specific file, so it's possible they're used somewhere else. But for "Tales of a Sea Hawk", that revised code should rename all of them either "Danielle's crewmember" or "Crewmember of Danielle" (if you choose to play as Danielle again), depending on language. You'll need to start the game all over again for it to take effect, though if you want to see if it worked without playing the whole way to the storm scene, you could put this into "console.c":
Code:
traceandlog("Blaze_Crewmember_01 is now called '" + GetMyFullName(CharacterFromID("Blaze_Crewmember_01")) + "'");
Then press F12 any time after the video of the French capture of Speightstown.
 
I'm wondering, wouldd it be possible to make the loading screen tips translatable? I guess so, same as the screens themselves, it'd be a matter of creating language folders with the images and setting the code for them in a similar fashion, right?
 
The previous version of "quests_reaction.c" was faulty and has been removed. This one works in English, Spanish and Russian.
 

Attachments

  • quests_reaction.c
    363.9 KB · Views: 64
I'm wondering, wouldd it be possible to make the loading screen tips translatable? I guess so, same as the screens themselves, it'd be a matter of creating language folders with the images and setting the code for them in a similar fashion, right?
Have a look at this:
Tutorial - Modding Tips & Tricks
In particular, the part about Windows Search Index. Use that to find one of the tips; hopefully that will show you the file which holds them.
 
The tips seem to be entirely random, so there's not any mention of a particular one in the files. The only reference seems to be a line used to disable them in various files (reload.c, reinit.c, worldmap_reload.c, WoodesRogers.c and Goldbug.c) but I see nothing to enable them in the first palce
Code:
if(sti(GetStorylineVar(FindCurrentStoryline(), "DISABLE_TIPS")) < 1) SetReloadNextTipsImage(); // JRH

The stock game has this in interface.c, but not the mod
Code:
#event_handler("Fader_GetTipsPath","procGetTipsPath");

(...)

string g_sTipsPath;
ref procGetTipsPath()
{
    string sLngID = LanguageGetLanguage();
    if(sLngID=="")    g_sTipsPath = "tips";
    else g_sTipsPath = "tips\" + sLngID;
    return &g_sTipsPath;
 
I've found them. They're not text files, they're texture files in "RESOURCE\Textures\Tips".

See what happens if you translate a few, make a folder "RESOURCE\Textures\Tips\SPANISH", and put your translated versions in there. Change "engine.ini":
Code:
numoftips = 77
to match however many tips you have translated - it's probably no coincidence that "RESOURCE\Textures\Tips" contains "tips_0000.tga.tx" to "tips_0076.tga.tx".
 
See what happens if you translate a few, make a folder "RESOURCE\Textures\Tips\SPANISH", and put your translated versions in there. Change "engine.ini":
I tried with just one for starters. Indeed, after putting numoftips = 1 in engine.ini, the game only displays the first one (tip_0000.tga.tx) but only the English version. I guess it needs some form of "RESOURCE\Textures\Tips\" + LanguageGetLanguage() code somewhere like the loading screens have
 
Back
Top