• 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

Next batch. It includes the loose files I've posted in this page so they don't get lost (smuggling.c, CharacterUtilite.c and the Spanish Colombian_silver.txt) aswell as:

shipyard.c with three new strings from the upgrade menu:
Only available in Pirate Shipyards!
Click Install to Remove the upgrade
This upgrade can't be removed

quest_common.c with the fetchquest shipslogs

Towntables.c with the rest of the random events shipsilogs

ENG and SPA common.ini (fetch quest requester), interface_strings.txt (also updated with the latest locations from the Russian thread) and shipslog_strings.txt
 

Attachments

  • SPAfiles.zip
    305.5 KB · Views: 67
What do you have to do to trigger the log "Merchant Guild Member Killed"? It's related to MerchantGuildAttack, which from what I gather is related to mugging a street merchany. I f you then kill him, the log should trigger? I tried that and nothing happened

Also, there's a slight problem in the merchant escort quest dialog from anacleto_dialog.c
Code:
        case "prepare_convoy_quest_3":
            string dText = DLG_TEXT[37];
            string sTownName = FindDestinationName(""); // PB: was FindTownName(pchar.quest.generate_convoy_quest.destination);
            string sIslandName = FindIslandName(GetIslandIDFromTown(pchar.quest.generate_convoy_quest.destination)); // PB
            if(pchar.quest.generate_convoy_quest.destination==DEFAULT_DESTINATION) { dText = DLG_TEXT[38]; }
            dialog.text = DLG_TEXT[30] + sIslandName + dText + sTownName + DLG_TEXT[31] + sti(pchar.quest.generate_convoy_quest.convoymoney) + DLG_TEXT[32];
FindDestinationName is defined in quests_common.c
Code:
                if(FindLocation(sdest)!=-1) sDestin = FindTownName(PChar.quest.generate_convoy_quest.destination) + " " + TranslateString("", "SeaPort");
The problem is with the final "("", "SeaPort")", which doesn't follow Spanish grammar resulting in, for example "Caratgena puerto" instead of "puerto de Cratagena". Instead of going to the trouble of rewritting the function to follow proper grammar, I suggest simply removing the "SeaPort", leaving just the name of the town.
 
The problem with leaving out "port" is that you might get the idea that you need to be in the town itself to complete the quest. So you moor at a beach, walk into town, and nothing happens.

How about this version of "quests_common.c"?
Code:
                if(FindLocation(sdest)!=-1)
                {
                    switch(LanguageGetLanguage())
                    {
                        case "SPANISH": sDestin = "Puerto de "+ FindTownName(PChar.quest.generate_convoy_quest.destination); break;
                        sDestin = FindTownName(PChar.quest.generate_convoy_quest.destination) + " " + TranslateString("", "SeaPort");
                    }
                }
That opens up the possibility for @AkrimalS to do something specific for Russian if the default "Cartagena Port" (in Cyrillic) is wrong.

"Puerto de " can be hard-coded here because the only way it will be shown is if you're playing in Spanish. So we don't need to worry whether "SeaPort" needs to have "of" added to it.)
 

Attachments

  • quests_common.c
    278.9 KB · Views: 53
@Grey Roger , looking for more log entries, I see that usurer_dialog.c already has preprocessors added to the variables needed for the log entry but instead of "PrePrecessor_Add" they use "PreProcessor_AddQuestData". Can they be used for the entry all the same? I tried and it didn't work, but it may have been a mistake on my part: the loanshark dialog returned a blank box and i got this error.

Code:
COMPILE ERROR - file: dialogs\Usurer_Dialog.c; line: 55
function WriteNewLogEntry(args:4) doesnt accept 2 arguments

The original code with the preprocessed variables
Code:
            Preprocessor_AddQuestData("town", FindTownName(NPC_Area));
            Preprocessor_AddQuestData("island", FindIslandName(GetIslandIDFromTown(NPC_Area)));
            Preprocessor_AddQuestData("ammount", iLoanAmount);
            Preprocessor_AddQuestData("deadline", GetHumanDate(sti(Pchar.quest.(NPC_Area).win_condition.l1.date.year), sti(Pchar.quest.(NPC_Area).win_condition.l1.date.month), sti(Pchar.quest.(NPC_Area).win_condition.l1.date.day)));
            Preprocessor_AddQuestData("loanshark", GetMySimpleName(NPChar));

            WriteNewLogEntry("Visited "+FindTownName(GetCurrentTownID()),"I was desperate enough to borrow some money from the local loanshark. Now I have to return "+iLoanAmount+" plus interest to "+GetMySimpleName(NPChar)+" by "+GetHumanDate(sti(Pchar.quest.(NPC_Area).win_condition.l1.date.year), sti(Pchar.quest.(NPC_Area).win_condition.l1.date.month), sti(Pchar.quest.(NPC_Area).win_condition.l1.date.day))+".","Ship",true);

My attempt for the entry (I didin't use the preprocessor "town" in the title, because the string is already translated like that from other files)
Code:
WriteNewLogEntry(GetTranslatedLog("Visited")+" "+FindTownName(GetCurrentTownID()),PreProcessText(GetTranslatedLog("I was desperate enough to borrow some money from the local loanshark. Now I have to return #sammount# plus interest to #sloanshark# by #sdeadline#.","Ship",true)));
 
Last edited:
You should be able to use variables set up by 'PreProcessor_AddQuestData'. Both 'PreProcessor_AddQuestData' and 'PrePrecessor_Add' are defined in "PROGRAM\utils.c" and the only difference I can see is that while both of them set up attribute "data", 'PreProcessor_AddQuestData' also sets up attribute "QuestData". It's used for questbooks, such as the one which is written some way down after the log is written and then integer i is set depending on which loanshark you are visiting.

The danger of putting everything into the 'WriteNewLogEntry' line instead of setting up a couple of variables for the title and text is that making mistakes is easier and spotting them is harder - it took me some time to find this one! You've closed all your brackets at the end. So it's trying to include everything in the 'PreProcessText' command, including "Ship" and 'true', and that's why "error.log" is complaining that it's only found 2 arguments when 'WriteNewLogEntry' wants 4.

Try this:
Code:
WriteNewLogEntry(GetTranslatedLog("Visited")+" "+FindTownName(GetCurrentTownID()),PreProcessText(GetTranslatedLog("I was desperate enough to borrow some money from the local loanshark. Now I have to return #sammount# plus interest to #sloanshark# by #sdeadline#.")),"Ship",true);
 
@Grey Roger I've taken the liberty to adapt the marriage entry form Gov MR_dialog.c to Ardent's quest_reaction.c, as they're both almost the same, except the line about wit and charm and having tu duel the suitor. I think it should be ok, but I'm not sure and I can't play through the entire storyline to test it (perhaps you have some conviniently placed saved game?)
Code:
            Pchar.quest.leave_church.win_condition.l1 = "location";
            Pchar.quest.leave_church.win_condition.l1.location = "Santiago_town_01";
            Pchar.quest.leave_church.win_condition = "leave_church";
            string title, text;
            switch(GetAttribute(PChar, "sex"))
            {
                case "man": Preprocessor_Add("spouse", GetTranslatedLog("my beautiful wife")); break;
                case "woman": Preprocessor_Add("spouse", GetTranslatedLog("my handsome husband")); break;
            }
            Preprocessor_Add("name",GetMySimpleName(romance))
            title = GetTranslatedLog("Married #sspouse#"));
            text = GetTranslatedLog("On this wonderful day I married #sspouse#, #sname#. We're both very happy, and now I am going to finish this writing, because I have something more important to do...");
            WriteNewLogEntry(PreprocessText(title), PreprocessText(text),"Personal",true);
            Preprocessor_Remove("spouse");
            Preprocessor_Remove("name");
            Preprocessor_AddQuestData("romance", GetMySimpleName(romance));
            AddQuestRecord("Marriage", 11);
            Preprocessor_Remove("romance");
            ChangeCharacterReputation(PChar, 5);
            if(AUTO_SKILL_SYSTEM)
            {
                AddPartyExpChar(pchar, "Leadership", 500);
                AddPartyExpChar(PChar, "", 50);
            }
            else {AddPartyExp(pchar, 550);}
        break;

And the original

Code:
            Pchar.quest.leave_church.win_condition.l1 = "location";
            Pchar.quest.leave_church.win_condition.l1.location = "Santiago_town_01";
            Pchar.quest.leave_church.win_condition = "leave_church";
            if (PChar.sex == "man") WriteNewLogEntry("Married my beautiful wife", "On this wonderful day I married my beautiful wife, "+GetMySimpleName(romance)+". We're both very happy, and now I am going to finish this writing, because I have something more important to do...","Personal",true);
            else WriteNewLogEntry("Married my handsome husband", "On this wonderful day I married my handsome husband, "+GetMySimpleName(romance)+". We're both very happy, and now I am going to finish this writing, because I have something more important to do...","Personal",true);
            Preprocessor_AddQuestData("romance", GetMySimpleName(romance));
            AddQuestRecord("Marriage", 11);
            Preprocessor_Remove("romance");
            ChangeCharacterReputation(PChar, 5);
            if(AUTO_SKILL_SYSTEM)
            {
                AddPartyExpChar(pchar, "Leadership", 500);
                AddPartyExpChar(PChar, "", 50);
            }
            else {AddPartyExp(pchar, 550);}
        break;
 
Please put them back as they were. I intentionally put the marriage code into "Gov MR_dialog.c" so that others could use it for similar ceremonies in other quests or storylines. You'll also find code for Hornblower's simpler ceremony on there for the same reason.
 
But then the Ardent marriage log won't be translated, right? Or does Ardent use the code in Gov_MR_dialog.c too?
 
Last edited:
Anyway, speaking of Ardent, the pronouns in at least some of the questbook entries are not translated ("entregarher" and "encontrarher" should be "entregarla" and "encontrarla"). I've been able to fix a couple of these in dialogs, but I don't know where the questbook gets them from.

1684531702527.png

btw, I generally prefer the brown UI to the blue one, but there's not denying that the light yellow writting in the questbook and log is much more readable on a blue background, than on an also light yellow background.

Edit. Found it
 

Attachments

  • quests_reaction.c
    684.6 KB · Views: 53
Last edited:
In the meantime, new batch of files

CCCFunctions.c: "Merchant Guild member killed" log entry
Dialog_func.c: log entries for captured or ransacked towns
INTERFACE/Itemstrade.c: log entries for buying/selling personal items
usurer_dialog.c: log entries for loans/deposits
Ardent/quests/both_reaction.c: "Captured!" log entries
Ardent/quests/quests_reaction.c: fixed pronouns in "Vilain_Hunt" questbook
CCCdirectsail.c: compass headings in DirectSail (dead ahead, starboard bow, etc.)
QUESTS/quests_common.c: "puerto de " for merchant escort quest

ENG and SPA common.ini, interface_strings.txt and shipslog_strings.txt

Several dialog and questbook files
: small fixes like untranslated requester and cargo for fetchquests, a couple of missing commas and typos
 

Attachments

  • SPAfilesMay20.zip
    450.7 KB · Views: 54
Last edited:
Three files with Spanish switches for better grammatical order in some strings (ship design and daily morale report). These are a blast from the past from my 2017 files, and with this I think pretty much everything I had translated in those old files but didn't go in ultimately because they were a hot mess, is complete. Finally I'll be able to delete that old version of the game that's been sitting there taking up 13GB of my hard drive for the last six years.
 

Attachments

  • DailyCrewUpdate.c
    29.7 KB · Views: 41
  • ship.c
    47.7 KB · Views: 33
  • shipyard.c
    185.1 KB · Views: 33
Last edited:
But then the Ardent marriage log won't be translated, right? Or does Ardent use the code in Gov_MR_dialog.c too?
Yes, cases "Wedding_consent1_answer" and "Married" set Lucia/Edmundo to use "Gov MR_dialog.c", then "reception_chat_to_romance" sets them back to use "romance_dialog.c" in time for the wedding reception.
Anyway, speaking of Ardent, the pronouns in at least some of the questbook entries are not translated ("entregarher" and "encontrarher" should be "entregarla" and "encontrarla"). I've been able to fix a couple of these in dialogs, but I don't know where the questbook gets them from.
Use this version of "quests_reaction.c" instead. I found the problem myself as well, a missing 'XI_ConvertString', but this version has some other corrections and is my current version. In particular, it makes provision for translating ship names, not too important for Spanish but definitely useful for Russian. Therefore, also added is Ardent's Spanish "storyline_strings.txt" with all the ship names from the storyline added. And the attached "interface_strings.txt" corrects the line for "ALARM! AN AMBUSH!!!" to match the text in "CCCFunctions.c" - I tested my revised "quests_reaction.c" on the "Hunt for Piers Downing" questbook and in the process found that line wasn't being translated because of a mismatch.
 

Attachments

  • quests_reaction.c
    684.7 KB · Views: 40
  • storyline_strings.txt
    1,003 bytes · Views: 38
  • interface_strings.txt
    139 KB · Views: 37
I've been finding a few bits and pieces left untranslated in the UI (like the map laegend that had gone completely under my radar for years). AMong them, the name of the storyline when you select a saved profile.
1684763463025.png


I've located the code in save_load.c
Code:
SetFormatedText("TEXTWINDOW", TranslateString("","Delete profile confirm"));
    if (iShowStoryline == iCurStoryline && sCurProfile == sShowProfile)
        SetFormatedText("TEXTWINDOW1", TranslateString("", "Storyline") + ": " + GetStorylineTitle(iShowStoryline) + ", " + TranslateString("", "Profile") + ": " + sShowProfile + GlobalStringConvert("newline") + TranslateString("", "Warning: this profile is currently active!"));
    else
        SetFormatedText("TEXTWINDOW1", TranslateString("", "Storyline") + ": " + GetStorylineTitle(iShowStoryline) + ", " + TranslateString("", "Profile") + ": " + sShowProfile);

I see that other files use the command "GetTranslatedStoryLine" but it doesn't seem to work here. Any other step needed to set it up?
 
Last edited:
'GetTranslatedStoryLine' is defined in "PROGRAM\MAXIMUS_Functions.c":
Code:
string GetTranslatedStoryLine(int idx, string strName)
It needs the story's index number and the string to be translated.

Where the code in "save_load.c" currently has:
Code:
GetStorylineTitle(iShowStoryline)
...
try:
Code:
GetTranslatedStoryLine(iShowStoryline, GetStorylineTitle(iShowStoryline))

By the way, the section of "save_load.c" which you quoted seems to be for when you want to delete a profile. There are other places where 'GetStorylineTitle' is called and you'll probably need to use 'GetTranslatedStoryLine' on all of them. Make sure that whatever variable or function is being used as the index for 'GetStorylineTitle' is also used as the index for 'GetTranslatedStoryLine' - it isn't always 'iShowStoryline'!
 
That did the trick. Which makes for the next batch

This one comes with:

-INTERFACE/a_map.c: translated map legend
-INTERFACE/save_load.c: Translated storyline names aswell as the profile delete popup: "Delete profile confirm" was missing a proper "translation" in English so I added that too to interface_strings ("Are you sure you want to remove this profile?").
-INTERFACE/Ship.c and shipyard.c: switches for correct Spanish word order: "Spanish design" > "Diseño español"
-WorldMap/DailyCrewUpdate.c: switch for correct Spanish word order: "high morale" > "moral alta"
-dialog_func.c: switch for correct Spanish word order of ShipDescribe: "32-gun frigate" >"fragata de 32 cañones"
>I'm quite proud of this one because I worked it out myself from scratch and not just from my old files like the others.

-A few more general dialog fixes, and abouthalf of the Tales of a Sea Hawk storyline dialogs translated (will need further testing to make sure there's no missing/excess commas or that the proouns are translated and so on, only tested Silehard thoroughly).

-All new strings added to both interface_strings.txt and a couple of typos in SPA shiplogs_strings.txt

EDIT:
last minute update to the zip with
-INTERFACE/ransack_main.c, transfer_cannons.c, transfer_crew.c and transfer_goods.c: switches for correct Spanish word order: Dead captain >Capitán muerto
 

Attachments

  • SPAfilesMay22 FINAL.zip
    289.2 KB · Views: 38
Last edited:
Ok, I know what I just said but these are the last ones, I swear. Just a couple switches more in the ransack interface for the "Dead captain" string. I edited my last zip to add them.

I discovered "strlower" yesterday and it's really useful to properly un-capitalize these order switches
 
Last edited:
About "Dialog_func.c": your new Spanish section looks fine, but the overall function is a bit messy due to the way the Polish section was done, meaning there are two language-based switch blocks each with only one language! Since the Polish one only seems to do anything if 'accusative' is set, I put the condition inside the Polish switch block, which meant I could then put the whole Polish section into the same switch as the Spanish section. Try this version - I've still to do some more checking on it but it seems to work in English, which at least means I haven't done anything serious enough to break the function entirely or crash the game.

If you're finished for now, and if @AkrimalS is ready for a pause in the Russian translation, it's time for me to assemble the whole lot into a full update.
 

Attachments

  • Dialog_func.c
    106.7 KB · Views: 40
If you're finished for now, and if @AkrimalS is ready for a pause in the Russian translation, it's time for me to assemble the whole lot into a full update.
If you make the code to display Hornblower's video and make the audio files from the VOICE folder play, then in principle you can release a patch, since translation fixes can be rolled out, but the code cannot (21 new dialogues from the Hornblower movie have been uploaded - all Foster and Hammond dialogues) . I also uploaded a file with translated ships to the Russian branch, they also need to be launched somehow. Need Help - Updating the Russian Translation
 
Last edited:
Back
Top