• 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

@Homo eructus: here's a new version of English "interface_strings.txt" with a couple of new lines 230 and 231:
Code:
of the crew is cursed due to{of the crew is cursed due to}
Aztec coins{Aztec coins}
That, plus a revised version of "PROGRAM\WorldMap\DailyCrewUpdate.c", should allow on-screen messages about crew cursed by coins to be translatable.

Also, have a look at this part of the thread about the Russian translation:
Need Help - Updating the Russian Translation

If you go to Tortuga and talk to one of the women wandering around town, you'll probably have a conversation in English and then get smacked. The conversation is hard-coded into "Dame_dialog.c" and couldn't be translated. I've moved the text into "Dame_dialog.h" with a blank first line which you'll need for the Spanish inverted exclamation mark.
 

Attachments

  • interface_strings.txt
    124.1 KB · Views: 73
  • DailyCrewUpdate.c
    29.2 KB · Views: 66
Last edited:
For a female knight (riddare) I would suggest the male form riddare too. Such cases exists in swedish.
Baron is called friherre.

Borgmästare was the title of a towns boss.
Landshövding is the boss of a province.
Riksråd was a very high title. Just a few of them around the king I guess.
 
Is there a Swedish equivalent to Spanish Hidalgo? This is an untitled nobleman - a Spanish privateer won't become a full Knight, or Caballero, until rank 8. And is there anything between Friherre and Greve, similar to a British Viscount or Dutch Burggraaf? Then Sweden could have:
7: ?
8: Riddare
9: Friherre / Friherrinna
10: ?
11: Greve / Grevinna
12: Riksråd (or something equivalent to British Marquis)
 
@Homo eructus: here's a new version of English "interface_strings.txt" with a couple of new lines 230 and 231:
Code:
of the crew is cursed due to{of the crew is cursed due to}
Aztec coins{Aztec coins}
That, plus a revised version of "PROGRAM\WorldMap\DailyCrewUpdate.c", should allow on-screen messages about crew cursed by coins to be translatable.

Also, have a look at this part of the thread about the Russian translation:
Need Help - Updating the Russian Translation

If you go to Tortuga and talk to one of the women wandering around town, you'll probably have a conversation in English and then get smacked. The conversation is hard-coded into "Dame_dialog.c" and couldn't be translated. I've moved the text into "Dame_dialog.h" with a blank first line which you'll need for the Spanish inverted exclamation mark.
I'll get to it as soon as possible. But I want to be done with a file before starting with the next, which leads me to...

What do i have to do to apply a preprocessor to these strings in shipyard.c that are not sLogEntry but are attached to it? Only the basic "Visited the local shipwright" string is defined as sLogEntry, and everything after is "sLogEntry +" so the usual "PreprocessText(sLogEntry)" doesn't apply to all the various repair/sell/buy/upgrade logs which need a lot of preporcessors to be translatable in one string each. How should I go about applying "Preprocesstext" to these strings?
Code:
sLogEntry += GetTranslatedLog("The shipwright agreed to repair the '#scurchrship#' for the amount of #scost# pieces of gold.")+" ";
Code:
sLogEntry += GetTranslatedLog("Sold the '#sarcurship#', a #srship# for #ssellprice# pieces of gold.")+" ";
etc.

All the preprocessors are added and deleted, only the final touch remains.

It just occured to me while writing, could I just do smething like this? I can't believe something this obvious didn't cross my mind.
Code:
PreprocessText(GetTranslatedLog("Sold the '#sarcurship#', a #srship# for #ssellprice# pieces of gold."))
 
Last edited:
Now the problem is precisely the base sLogEntry, when I apply GetTranslatedLog to it, it doesn't appear ingame.
This is the original in shipyard.c
Code:
string sLogEntry = "Visited the local shipwright. ";
And this is what I've done. Should be the simplest thing, but this particular string doesn't like it.
Code:
string sLogEntry = GetTranslatedLog("Visited the local shipwright.")+" ";
I've checked and rechecked that the string is correct in both shipslog_strings files. I tried adding it to interface_strings with TranslateString just to check and it didn't work either.
 
Is there a Swedish equivalent to Spanish Hidalgo? This is an untitled nobleman - a Spanish privateer won't become a full Knight, or Caballero, until rank 8.
No. Maybe just "adlig".
And is there anything between Friherre and Greve, similar to a British Viscount or Dutch Burggraaf?
No, there isn't.
 
Is there something about it in "error.log", or does the message simply not show up?

A useful command is 'traceandlog'. This simultaneously shows a string on screen and dumps it into "compile.log". For example, right above the 'WriteNewLogEntry' command, add a 'traceandlog' command to show what is supposed to go into the log.

I've been doing a bit of work on ship logs for random nation changes. At the expense of some added complexity in "nations.c", e.g.:
Code:
            case RELATION_NEUTRAL:
                random = rand(2);
                if(random==0)
                {
                    logTitle = GetTranslatedLog("#snationnamei# and #snationnamej# have allied");
                    logEntry = GetTranslatedLog("#snationnamei# and #snationnamej# have formed an alliance. Attacking ships or towns of either nation will also decrease the standing with the ally.");
                    if(GetNationRelation2MainCharacter(i)==RELATION_FRIEND && GetNationRelation2MainCharacter(j)==RELATION_FRIEND) logEntry += " " + GetTranslatedLog("Very good news, indeed. Working for the #snationdesci# and the #snationdescj#, as I currently do, my deeds will raise my standing with both nations.");
                    if(GetNationRelation2MainCharacter(i)==RELATION_ENEMY && GetNationRelation2MainCharacter(j)==RELATION_ENEMY) logEntry += " " + GetTranslatedLog("Whoops! It seems I have bothered them a little too much. But their alliance won't stop me.");
                    if(IsInServiceOf(i) && GetNationRelation2MainCharacter(j)==RELATION_ENEMY)
                    {
                        Preprocessor_Add("nationdesc1", XI_ConvertString(GetNationDescByType(i)));
                        Preprocessor_Add("nationdesc2", XI_ConvertString(GetNationDescByType(j)));
                        logEntry += GetTranslatedLog("\n \nThis makes working for the #snationdesc1# somewhat more difficult, as sinking #snationdesc2# ships is no longer an option.");
                    }
                    if(IsInServiceOf(j) && GetNationRelation2MainCharacter(i)==RELATION_ENEMY)
                    {
                        Preprocessor_Add("nationdesc2", XI_ConvertString(GetNationDescByType(i)));
                        Preprocessor_Add("nationdesc1", XI_ConvertString(GetNationDescByType(j)));
                        logEntry += GetTranslatedLog("\n \nThis makes working for the #snationdesc1# somewhat more difficult, as sinking #snationdesc2# ships is no longer an option.");
                    }
                    newRelation = RELATION_FRIEND;
                }
                if(random==1)  // i declared war on j
                {
                    Preprocessor_Add("nationdesc1", XI_ConvertString(GetNationDescByType(i)));
                    Preprocessor_Add("nationdesc2", XI_ConvertString(GetNationDescByType(j)));
                    Preprocessor_Add("nationname1", XI_ConvertString(GetNationNameByType(i)));
                    Preprocessor_Add("nationname2", XI_ConvertString(GetNationNameByType(j)));
                    logTitle = GetTranslatedLog("#snationname1# is at war with #snationname2#");
                    logEntry = GetTranslatedLog("#snationname1# has declared war on #snationname2#.") + " " + GetTranslatedLog("#snationdesc1# ships have attacked a small #snationdesc2# settlement, as I was told.");
                    if(IsInServiceOf(i) && GetNationRelation2MainCharacter(j)==RELATION_ENEMY) logEntry += GetTranslatedLog("\n \nIt was about time to show those #snationdesc2# landlubbers who's in charge in the Caribbean!");
                    if(IsInServiceOf(j) && GetNationRelation2MainCharacter(i)==RELATION_ENEMY) logEntry += GetTranslatedLog("\n \nThose bloody cowards! The next #snationdesc1# ship we encounter will surely pay for this.");
                    newRelation = RELATION_ENEMY;
                }
                if(random==2)  // j declared war on i
                {
                    Preprocessor_Add("nationdesc1", XI_ConvertString(GetNationDescByType(j)));
                    Preprocessor_Add("nationdesc2", XI_ConvertString(GetNationDescByType(i)));
                    Preprocessor_Add("nationname1", XI_ConvertString(GetNationNameByType(j)));
                    Preprocessor_Add("nationname2", XI_ConvertString(GetNationNameByType(i)));
                    logTitle = GetTranslatedLog("#snationname1# is at war with #snationname2#");
                    logEntry = GetTranslatedLog("#snationname1# has declared war on #snationname2#.") + " " + GetTranslatedLog("#snationdesc1# troops have landed near #snationtown2#, as I was told.");
                    if(IsInServiceOf(i) && GetNationRelation2MainCharacter(j)==RELATION_ENEMY) logEntry += GetTranslatedLog("\n \nThose bloody cowards! The next #snationdesc1# ship we encounter will surely pay for this.");
                    if(IsInServiceOf(j) && GetNationRelation2MainCharacter(i)==RELATION_ENEMY) logEntry += GetTranslatedLog("\n \nIt was about time to show those #snationdesc2# landlubbers who's in charge in the Caribbean!");
                    newRelation = RELATION_ENEMY;
                }
            break;
... I was able to delete duplicate entries in "shipslog_strings.txt". The extra code ensures that "#snationname1#" and "#snationdesc1#" always refer to the nation which declared war, broke an alliance etc., which means "shipslog_strings.txt" does not need near identical lines depending on whether nation i or nation j was the offender.

I also noticed that with all the arranging of various components now done to variables 'logTitle' and 'logEntry', all the 'WriteNewLogEntry' commands are now identical, so I removed all the duplicates and put one command right before all the 'Preprocessor_Delete' commands. And then no log entries appeared. I tried putting:
Code:
traceandlog("logTitle = '" + logTitle + "', logEntry = '" + logEntry + "'");
before the 'WriteNewLogEntry' command, and that didn't show anything either. The reason is that all these commands were inside the 'switch(GetNationRelation(i,j))' block, below the last 'break', which is where you'd put commands to take care of any value of the switch that is not covered by any 'case' block. I moved the whole lot below the last "}" of the switch and immediately before "// STEP 3", and then both the logs and the traces appeared. (I deliberately didn't put the 'PreprocessText' command into the 'traceandlog' so that I'd see the raw text - if any variable text had failed to appear in the log, the unprocessed text would show which variable wasn't working.)

Attached are the revised "nations.c" and Spanish "shipslog_strings.txt". The latter will, of course, not include any of your newest work!
 

Attachments

  • nations.c
    68.5 KB · Views: 83
  • shipslog_strings.txt
    50.7 KB · Views: 61
No. Maybe just "adlig".

No, there isn't.
How about this:
Code:
            rNation.Titles.7 = "Adlig";
            rNation.Titles.8 = "Riddare";
            rNation.Titles.9 = "Friherre";
            rNation.Titles.10 = "Borgmästare";
            rNation.Titles.11 = "Greve";
            rNation.Titles.12 = "Riksråd";
Level 7 is an untitled noble similar to Spanish Hidalgo, Riddare and Friherre go to levels 8 and 9 similar to Caballero and Barón, Greve goes to level 11 as the equivalent to Conde. A count could have authority over a region of land (which is where the English word "county" originated), so Borgmästare, administrator of a single town, could remain at level 10, one level down from Greve.

How about "Herre" for level 7? Google translates Spanish "Hidalgo" to Swedish "Herre" - might that be suitable? (Yes, Google is very unreliable, which is why I'm asking. :D)
 
Herre is a little bit troublesome as it also means God.
Maybe godsägare = owner of an estate?
 
Is there something about it in "error.log", or does the message simply not show up?

A useful command is 'traceandlog'. This simultaneously shows a string on screen and dumps it into "compile.log". For example, right above the 'WriteNewLogEntry' command, add a 'traceandlog' command to show what is supposed to go into the log.
No error, but the string works without the translation commands

What should I put in the traceandlog? compile.log returns simply "LogEntry = xxx", xxx being wahtever I put in the command, which doesn't seem that helpful to me.

This is the WriteNewLogEntry command, in case it matters
Code:
WriteNewLogEntry(GetTranslatedLog("Visited")+" "+FindTownName(GetCurrentTownID()),sLogEntry,"Ship",true);
The log title is directly there instead of calling on a previously defined LogTitle. I tried doing that just in case but it didn't change anything
 
Last edited:
What should I put in the traceandlog? compile.log returns simply "LogEntry = xxx", xxx being wahtever I put in the command, which doesn't seem that helpful to me.
You can put whatever you like into the 'traceandlog'!

If you added 'traceandlog("LogEntry = " + LogEntry);', and you saw "LogEntry = xxx", it at least proves that the game got as far as the 'traceandlog' command. The fact that I didn't see a log entry during one of my experiments could have been due to a mistake in the 'WriteNewLogEntry' command, but if 'traceandlog' didn't put anything into "compile.log" then that meant the game wasn't even getting to that part of the code. That's what led me to the conclusion that the code was in the wrong place, still inside a 'switch' block.

Or, if "xxx" is an assembled string such as 'GetTranslatedLog("Visited")+" "+FindTownName(GetCurrentTownID())', adding 'traceandlog(GetTranslatedLog("Visited")+" "+FindTownName(GetCurrentTownID()));' will show the results of the assembly - if it doesn't look correct then the assembled string won't work properly in 'WriteNewLogEntry' either.

This is the WriteNewLogEntry command, in case it matters
Code:
WriteNewLogEntry(GetTranslatedLog("Visited")+" "+FindTownName(GetCurrentTownID()),sLogEntry,"Ship",true);
The log title is directly there instead of calling on a previously defined LogTitle. I tried doing that just in case but it didn't change anything
I'd need to see both the .c file and your current "shipslog_strings.txt" to try to find out what is going wrong.
 
Then I'll update shipslog_strings.txt with your latest changes and then upload it and shipyard.c so you can take a look. It'll probbaly take some days though, we're getting to the end of the school year and things are a little hectic right now with a giant pile of exams on my desk.
 
That's alright, I have a few other things to do as well.

Among them, loading screens - I've been asked to make a few new loading screens with Russian text, and since that involves putting a blank background screen over the existing text and then adding in the replacement Russian, it's easy enough to do a Spanish version at the same time. Most of them are easy enough by copying entries from "common.ini", "interface_strings.txt" or "storyline_strings.txt". But how would you translate "Governor Eden's Estate June 1718"? Looking at Google Translate, there seem to be several different translations of "Estate" depending on whether it's general property to be left in a will or a patch of land. This one is the patch of land, which Google translates as "La finca", so "Governor Eden's Estate" would be "La Finca Del Gobernador Eden" - is that correct?
 
I'd need to see both the .c file and your current "shipslog_strings.txt" to try to find out what is going wrong.
Here.

The only string that give sme problems is "Visited the local shipyard"
 

Attachments

  • shipslog_strings.txt
    52 KB · Views: 55
  • shipyard.c
    184.7 KB · Views: 65
@Grey Roger There seems to be a problem with the changes you added to nations.c.
1683321828006.png

In this game, I'm a privateer serving Spain, so this entry about Spain declaring war on Holland by attacking a Dutch settlement should be followed by the line about teaching those landlubbers who's in charge. It worked before.

Also (I'm trying to catch up!)
That, plus a revised version of "PROGRAM\WorldMap\DailyCrewUpdate.c", should allow on-screen messages about crew cursed by coins to be translatable.

The following strings should be translated too, right?
Code:
if(sti(pchar.curseddays)==25)    LogIt("Captain, the crew is really not happy with this whole curse business. They work SO HARD at repairing the sails, but it appears to have no effect!"
);
if(sti(pchar.curseddays)==35)    LogIt("Captain, now the crew can't even see where they're going anymore with all this unnatural fog! Cannot you be persuaded to attempt to lift the curse?");

I'm searching for and adding some of the on-screen messages that I had translated back in my 2017 files, I'll upload the first batch soon and these could go in.

Edit: And I see you are doing some of that in the Russian translation thread. We probably should be coordinating better so we're not adding the same strings in different places and so the merging and updating of both translations can be made easier. Maybe a general localisation thread where all the translation coding needed in the PROGRAM side can be centralized and shared among the translators of each language? Or some kind of repository where we can edit the files online (at least the ones that are more frequently edited like interface_strings) so we can more easily ensure that they're up to date? I don't know, I'm not great at management myself, but we should be able to find a more efficient workflow now with two active translations.
 
Last edited:
@Grey Roger There seems to be a problem with the changes you added to nations.c.
View attachment 42031
In this game, I'm a privateer serving Spain, so this entry about Spain declaring war on Holland by attacking a Dutch settlement should be followed by the line about teaching those landlubbers who's in charge. It worked before.
It works for me:
spain_holland_war.jpg

Attached are my current versions of "nations.c" and Spanish "shipslog_strings.txt".
The following strings should be translated too, right?
Code:
if(sti(pchar.curseddays)==25)    LogIt("Captain, the crew is really not happy with this whole curse business. They work SO HARD at repairing the sails, but it appears to have no effect!"
);
if(sti(pchar.curseddays)==35)    LogIt("Captain, now the crew can't even see where they're going anymore with all this unnatural fog! Cannot you be persuaded to attempt to lift the curse?");
Yes. Also attached is "DailyCrewUpdate.c" with those lines now sent to 'TranslateString', and Spanish "interface_strings.txt" with several placeholder "translations" still in English. Look to line 230 for some text about cursed coins, and also at line 445 for some text about storms.

Edit: And I see you are doing some of that in the Russian translation thread. We probably should be coordinating better so we're not adding the same strings in different places and so the merging and updating of both translations can be made easier. Maybe a general localisation thread where all the translation coding needed in the PROGRAM side can be centralized and shared among the translators of each language? Or some kind of repository where we can edit the files online (at least the ones that are more frequently edited like interface_strings) so we can more easily ensure that they're up to date? I don't know, I'm not great at management myself, but we should be able to find a more efficient workflow now with two active translations.
If I could ever figure out how to use GitHub, that would be the place. Otherwise, I'll try to keep a watch on both translations - it won't matter if the Spanish and Russian versions have the same line translated at different places in the files, I'll just move the translated lines in one so that it matches the other, and also put untranslated lines into the English version.

But I do like the idea of one unified translation thread so that Spanish and Russian translators can more easily see each others' work. If they don't choose to translate the same lines, I'll do what I did to "interface_strings.txt" here, which is to put placeholder texts into the file so that at least something appears on screen.
 

Attachments

  • nations.c
    68.5 KB · Views: 55
  • shipslog_strings.txt
    50.7 KB · Views: 70
  • DailyCrewUpdate.c
    29.2 KB · Views: 61
  • interface_strings.txt
    134.8 KB · Views: 62
Back
Top