• 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

Oh, damn it, of course the nation relations screen also has flag windows with those titles for pirate and personal flags. And there's also the "Hoist flag" text in there that again has the translation code but is not in common.ini
...

Ugh, I hate it when things that ought to work, just don't. As I said "Hoist flag" already had the translation code added
Code:
    }

    CreateString(true, "HoistFlag", TranslateString("", "Hoist flag") + ":", FONT_NORMAL, COLOR_NORMAL, 30, 385, SCRIPT_ALIGN_LEFT, 0.75);
So it should be as easy as adding
Code:
string = Hoist flag,"Izar bandera"
to common.ini, but it doesn't work

Edit: wait, nvermind I forgot about interface_strings. It works when the string is added there.
 
I still can't get my head around what goes in common.ini and what goes in interface_strings, nad how TranslateString sometimes works with both of them and sometimes doesn't.
 
I still can't get my head around what goes in common.ini and what goes in interface_strings, nad how TranslateString sometimes works with both of them and sometimes doesn't.
Isn't it that XI_ConvertString uses common.ini and TranslateString uses a bunch of other files?
XI_ConvertString was part of the original game; TranslateString was added when @Maximus and @konradk added multi-language support.
 
'XI_ConvertString' only uses "common.ini", so anything which has to be translated by 'XI_ConvertString' must go there.

'TranslateString' goes in sequence through "common.ini", "interface_strings.txt", general "characters_names.txt", storyline-specific "characters_names.txt", general "ItemsDescribe.txt", storyline-specific "ItemsDescribe.txt", and finally "GoodsDescribe.txt". It will return the first match it finds in that sequence. So if a string exists in both "common.ini" and "interface_strings.txt", the translation from "common.ini" will take precedence.

(Looking through "interface_strings.txt" for any existing mention of "hoist", I found that "You have hoisted a Pirate flag! Argh!" is listed three times! Two of them can probably be deleted to save a bit of space.)
 
Aaanyway, here it is NationRelation.c with the flag titles added and both interface_strings with the "Hoist flag" string added. Also the Spanish common.ini because I rephrased a related string from the same relations screen that wasn't very clear.

I'll stop now before I fall further down the rabbit hole.

Ok, just one more. RESOURCE/INI/TEXTS/SPANISH/ControlsNames.txt had the wrong codification, messing up the special characters (á, é, ñ, etc.). Here's fixed.
 

Attachments

  • FlagsNationRealtion.zip
    99.3 KB · Views: 121
  • FlagsNationRealtion.zip
    99.3 KB · Views: 113
  • ControlsNames.txt
    5.9 KB · Views: 101
'XI_ConvertString' only uses "common.ini", so anything which has to be translated by 'XI_ConvertString' must go there.

'TranslateString' goes in sequence through "common.ini", "interface_strings.txt", general "characters_names.txt", storyline-specific "characters_names.txt", general "ItemsDescribe.txt", storyline-specific "ItemsDescribe.txt", and finally "GoodsDescribe.txt". It will return the first match it finds in that sequence. So if a string exists in both "common.ini" and "interface_strings.txt", the translation from "common.ini" will take precedence.

(Looking through "interface_strings.txt" for any existing mention of "hoist", I found that "You have hoisted a Pirate flag! Argh!" is listed three times! Two of them can probably be deleted to save a bit of space.)

This is the one. The string wasn't in any of the two files before, but for some reason it didn't work when I added it to common.ini, only with interface_strings
upload_2021-7-23_21-44-44.png
 
Strange that it does not work in "common.ini". As far as I can tell, that's coming from "PROGRAM\INTERFACE\NationRelation.c":
Code:
CreateString(true, "HoistFlag", TranslateString("", "Hoist flag") + ":", FONT_NORMAL, COLOR_NORMAL, 30, 385, SCRIPT_ALIGN_LEFT, 0.75);
And 'TranslateString' should check "common.ini" first.

Having said that, this is part of the F2 interface so it is an interface string, which means "interface_strings.txt" is probably the best place for it anyway. ;)
 
As apparently my concept of a vacation is taking a break from translating one nautical game to resume trnaslating another nautical game, I'm doing a few general dialogs. I wanted to fix the autotranslated mess in at least some of the starting and more commonly seen (stores, taverns, etc) dialogs.

Then I remembered I already had some 20 or so translated files from back in the day so I started with those isntead, as it's less work than starting from scratch, I only need to review them and compare them to the new ones, adding a new preprocessor or line of dialog here and there, where the English vversions have them.
 
Last edited:
Here's a first batch of 23 files, including Malcolm Hatcher's, which took most of today to do. The rest are the deck crewmembers' files and the first few files starting with the letter "a", as I started in alphabetical order back in 2017, insterad of more sensibly by order of importance. Still there's a couple of innkeeprs and traders and the Antigua naval officials. I've only tested a few of them thoroughly but they should be alright barring the inevitable typo here and there.
 

Attachments

  • DIALOGS.zip
    61.3 KB · Views: 95
Last edited:
Where's #senemy# defined? Or more exactly, where does the #senemy# function take its nationalities from? Because they're not being translated, so it's not any of the instances of the nationalities listed in common.ini or interface-strings.txt.
upload_2021-8-4_12-6-55.png
 
Where's #senemy# defined? Or more exactly, where does the #senemy# function take its nationalities from? Because they're not being translated, so it's not any of the instances of the nationalities listed in common.ini or interface-strings.txt.
View attachment 39165
"PROGRAM\DIALOGS\Malcolm Hatcher_dialog.c", case "start":
Code:
Preprocessor_Add("enemy",GetNationDescByType(iNation));
See what happens if you change that to:
Code:
Preprocessor_Add("enemy", XI_ConvertString(GetNationDescByType(iNation)));

The various nation descriptions are in "common.ini".

There's another one at case "start_engineer" - if you play as a FreePlay engineer, Malcolm goes through an extra pair of lines of dialog in which he gives you the letter for the engineer starting quest, then proceeds to case "start_engineer", which duplicates what case "start" has for any other character type.
 
The form of address Malcolm gives you, is it supposed to be relative to his own nationality or the player's? Because I started a freeplay as a Spanish merchant to check and he still calls me Sir, so I don't know if there's something missing there or if he just calls me sir because HE is English.
 
"sir" is set at cases "start", "start_engineer" and "intro3":
Code:
Preprocessor_Add("sir", GetMyAddressForm(NPChar, PChar, ADDR_POLITE, false, false));
Function 'GetMyAddressForm' does indeed use NPChar's nation, so if Malcolm is English then he will call you "sir" (unless you're female, in which case he calls you "ma'am").

"PROGRAM\Storyline\FreePlay\StartStoryline.c" can do various things to Malcolm depending on your player type - for one thing, several player types switch him to use "Robert Fletcher_dialog.c" for special dialog relevant to those characters. Most of those change his name, appearance and nation to suit your character, e.g. if you play a naval officer, he looks like a high ranking officer of the same nation. I'll maybe see if I can make it set Malcolm's nation to match yours for all character types, and maybe change his name to match, so that your Spanish merchant will be talking to a Spanish officer who calls you "señor".

Incidentally, if you want to look at "Robert Fletcher_dialog.h", you'll find it in "PROGRAM\Storyline\FreePlay\DIALOGS\SPANISH". "Robert Fletcher_dialog.h" is only for special FreePlay characters so it's in the "FreePlay" folder, whereas "Malcolm Hatcher_dialog.h" is used by both FreePlay and "Tales of a Sea Hawk" so it's in the general "DIALOGS" folder.
 
Here's a first batch of 23 files, including Malcolm Hatcher's, which took most of today to do. The rest are the deck crewmembers' files and the first few files starting with the letter "a", as I started in alphabetical order back in 2017, insterad of more sensibly by order of importance. Still there's a couple of innkeeprs and traders and the Antigua naval officials. I've only tested a few of them thoroughly but they should be alright barring the inevitable typo here and there.
I just realized one file in the batch (antigua_regulating) is in English, I misplaced it while I was copying and pasting them. I'll include the right version with the next batch, along with some typo fixes in other files.

Incidentally, if you want to look at "Robert Fletcher_dialog.h", you'll find it in "PROGRAM\Storyline\FreePlay\DIALOGS\SPANISH". "Robert Fletcher_dialog.h" is only for special FreePlay characters so it's in the "FreePlay" folder, whereas "Malcolm Hatcher_dialog.h" is used by both FreePlay and "Tales of a Sea Hawk" so it's in the general "DIALOGS" folder.
I think I'll do all the dialogs in the FreePlay folder next, there's only a handful of them.
 
You know, just in case I forget, I'll leave the fixed files here. Especially, Malcolm's needed some thorough fixing of some exposition strings that were too long in Spanish and were causing the game to crash. I've trimmed them down a little and I think everything works as it should.
 

Attachments

  • Malcolm Hatcher_dialog.h
    37.9 KB · Views: 98
  • Antigua_regulating.h
    10.8 KB · Views: 92
Thanks! :onya

Meanwhile, here's an updated version of "PROGRAM\Storyline\FreePlay\StartStoryline.c". It includes this, just before the switch on player character type which may customise Malcolm:
Code:
    if (GetCurrentFlag() != ENGLAND && GetCurrentFlag() != PERSONAL_NATION)
   {
       ch.nation = GetCurrentFlag();
       DeleteAttribute(ch, "questchar")
       SetRandomNameToCharacter(ch);
   }
If you're anything other than English or Personal, it sets Malcolm to the same nationality as you and then gives him a random name for that nation. I tested it by setting up a FreePlay as a Spanish merchant (and, for good measure, set the language to Spanish as well - I can't read much Spanish but I know my way around the game). The officer did indeed have a random Spanish name and called me "Señor".
 

Attachments

  • StartStoryline.c
    58.9 KB · Views: 90
As apparently my concept of a vacation is taking a break from translating one nautical game to resume trnaslating another nautical game, I'm doing a few general dialogs.
As much as I appreciate that... I really wished a better TRUE vacation would've been possible.
For you; and for me; and for us all...

I wanted to fix the autotranslated mess in at least some of the starting and more commonly seen (stores, taverns, etc) dialogs.

Then I remembered I already had some 20 or so translated files from back in the day so I started with those isntead, as it's less work than starting from scratch, I only need to review them and compare them to the new ones, adding a new preprocessor or line of dialog here and there, where the English vversions have them.
:bow :bow

I think I'll do all the dialogs in the FreePlay folder next, there's only a handful of them.
:woot
 
I was testing the rogue start and suddenly the door to the church of Havana where I'm supposed to take refuge is locked. It worked the first time I tried, but now it's locked every time I reload an earlier save or start a new game, and the only thing I've changed in the meantime is dialogs.

I got this error log one time but it must be unrelated because other times I don't get any errors and the door stays locked
Code:
RUNTIME ERROR - file: seadogs.c; line: 751
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 751
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 751
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 751
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 751
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 751
Save - ARef to non existing attributes branch
 
Back
Top