• 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

The English version calls it "A sinister Satanist amulet resembling a five-pointed star". The existing Spanish translation, "Un siniestro amuleto satánico con forma de estrella de cinco puntas", is the same. It might be nice to keep the translation consistent. ;)
As you wish. :doff
 
@Homo eructus, any comments? If you'd also prefer the Spanish version to describe the amulet as a pentagram rather than a five-pointed star, that's how it will be - you and @JTem are the ones who will be playing using the translation, after all.
 
I have no strong preference one way or the other. But in Spanish "pentagrama" is more often used to mean a stave for musical notation than a five-pointed star, which seems to be a more modern usage, probably borrowed form English (pentáculo would be a more specific word for a five-pointed star as an occult symbol).
 
For some time I've wanted to translate the period names from the storyline selection menu, as they were in my old files. They are already translated in common.ini, but don't have the corresponding XI_TranslateString in the periods.c file, so I added it. But they're not being translated for some reason.

This should be right, shouldn't it?
Code:
period.name = XI_ConvertString("Early Explorers");

Also, these lines from select_storyline.c would need to be edited too and the words Period and Date added to the relevant TEXTS file. I used TranslateString for those lines in my old files.
Code:
    CreateString(true, "LblData", "Date:", FONT_NORMAL, COLOR_NORMAL, 200, 268, SCRIPT_ALIGN_LEFT, 0.7);
    CreateString(true, "LblPeriod", "Period:", FONT_NORMAL, COLOR_NORMAL, 200, 289, SCRIPT_ALIGN_LEFT, 0.7);
 
Last edited:
Did you start a new game after changing "periods.c"? I'll try adding 'XI_ConvertString' to the "period.name" lines and see if it works for me.

Can you upload the Spanish text file with the translations for "Date" and "Period"? I'll probably need to merge it in with the current version of the same file so as not to lose any newer work, and I'll add "Date" and "Period" to the English version of the same file as well.
 
Did you start a new game after changing "periods.c"? I'll try adding 'XI_ConvertString' to the "period.name" lines and see if it works for me.
Hmm. After starting a new game and then going back to the new game manu, the period name strings were translated. But after quitting and restarting the game, they were back to English. Kind of defeats the purpose if you msut have already started a new game to have the new game menu properly translated.
 
Last edited:
Can you upload the Spanish text file with the translations for "Date" and "Period"? I'll probably need to merge it in with the current version of the same file so as not to lose any newer work, and I'll add "Date" and "Period" to the English version of the same file as well.
Sure. Should I add them at the bottom of common.ini or somewhere else?
 
"select_storyline.c" has several calls on 'GetPeriodName(curPeriod)'. Some of them are translated, some are not. Trying to translate something which has already been translated can cause problems, though not usually by converting it back into English - the translation either leaves the string alone or returns a blank.

One possibility might be to put "periods.c" back to not using 'XI_ConvertString'; change 'GetPeriodName' (defined in "periods.c) to use 'XI_ConvertString'; and then make sure that anything which calls 'GetPeriodName' does not try to translate it again.
 
I think I figured it out. These lines in select_storyline.c needed the translation code. It works now, for me at least
Code:
//Levis custom start date -->
    GameInterface.strings.StartYear = CharYear;
    GameInterface.strings.StartMonth = TranslateString("",GetMonthName(CharMonth));
    GameInterface.strings.StartDay = CharDay;
    GameInterface.strings.StartPeriod = TranslateString("", GetPeriodName(curPeriod));
    bool canchangedate = true;
    if(CheckAttribute(arstart,"date.lock")) canchangedate = false;
    SetNodeUsing("YEAR", canchangedate);
    SetNodeUsing("MONTH", canchangedate);
    SetNodeUsing("DAY", canchangedate);
    //Levis custom startdate <--

Further down in the same file there are these commented by Maximus with the code already in place, but they weren't working for me until I did it for the above strings:
Code:
                    GameInterface.strings.StartYear = CharYear;
                    GameInterface.strings.StartMonth = TranslateString("", GetMonthName(CharMonth)); //MAXIMUS 17.05.2019: needed for localization
                    GameInterface.strings.StartDay = CharDay;
                    GameInterface.strings.StartPeriod = TranslateString("", GetPeriodName(curPeriod)); //MAXIMUS 17.05.2019: needed for localization

I don't know if the redundancy could lead to trouble.
 
Sure. Should I add them at the bottom of common.ini or somewhere else?
You tell me. ;) I thought you already had files with translations for "Date" and "Period". If not, put them in "common.ini" - look for "DIFFICULTY NAME" and "TYPE NAME", which are groups of strings also used by "StartStoryline.c", and maybe put "Date" and "Period" below them. Or look for "Early Explorers", which is the section translating period names, and put the new strings there.
 
Ok. There are so many other untranslated strings in select_storylien.c (e.g. the titles for the pop-up windows for nation, flag, and profession selection) that I may do a few more. I don't want to overextend and break things so I'll try one at a time.
 
I think I figured it out. These lines in select_storyline.c needed the translation code. It works now, for me at least
Code:
//Levis custom start date -->
    GameInterface.strings.StartYear = CharYear;
    GameInterface.strings.StartMonth = TranslateString("",GetMonthName(CharMonth));
    GameInterface.strings.StartDay = CharDay;
    GameInterface.strings.StartPeriod = TranslateString("", GetPeriodName(curPeriod));
    bool canchangedate = true;
    if(CheckAttribute(arstart,"date.lock")) canchangedate = false;
    SetNodeUsing("YEAR", canchangedate);
    SetNodeUsing("MONTH", canchangedate);
    SetNodeUsing("DAY", canchangedate);
    //Levis custom startdate <--

Further down in the same file there are these commented by Maximus with the code already in place, but they weren't working for me until I did it for the above strings:
Code:
                    GameInterface.strings.StartYear = CharYear;
                    GameInterface.strings.StartMonth = TranslateString("", GetMonthName(CharMonth)); //MAXIMUS 17.05.2019: needed for localization
                    GameInterface.strings.StartDay = CharDay;
                    GameInterface.strings.StartPeriod = TranslateString("", GetPeriodName(curPeriod)); //MAXIMUS 17.05.2019: needed for localization

I don't know if the redundancy could lead to trouble.
That's not redundancy. They're in different functions. You'll find 'GetMonthName(CharMonth)' and 'GetPeriodName(curPeriod)' in several places. As of 6th July (actually from 13th September 2019, the file hasn't changed since then), they can be found:
  • Lines 205 and 208, function 'InitInterface'
  • Lines 798 and 800, function 'ChangeStoryline'
  • Lines 984 and 986, function 'RefreshScreen'
  • Lines 1379 and 1381, function 'ChangeStartDate'
Some already use 'TranslateString', some don't. So depending on exactly what you do when setting up your storyline, especially in FreePlay, you may or may not find translated period and month names.
 
Oh, I remember now I ran into this back in the day. The title "NATION" doesn't work with the current "nation" string in common.ini (probably because of the capitalization?), but if you add a "NATION" string to common.ini, it doesn't recognize it as different from "nation", so it still doesn't work. In my old files I worked around it by renaming the title "NATION1" in select_storyline and adding NATION1 as a new string. Is that an acceptable solution or there's a better one?

upload_2021-7-23_12-42-56.png
I don't wnat to get sucked by this rabbit hole again, but I don't like to leave things half-done either.
 
Some already use 'TranslateString', some don't. So depending on exactly what you do when setting up your storyline, especially in FreePlay, you may or may not find translated period and month names.
Well, as far as I can tell, it's working with all storylines and all the free play chartacter types I've tried, so it seems to work.
 
Oh, I remember now I ran into this back in the day. The title "NATION" doesn't work with the current "nation" string in common.ini (probably because of the capitalization?), but if you add a "NATION" string to common.ini, it doesn't recognize it as different from "nation", so it still doesn't work. In my old files I worked around it by renaming the title "NATION1" in select_storyline and adding NATION1 as a new string. Is that an acceptable solution or there's a better one?
Yes, defining a separate string seems to be the only solution. There's a whole section of upper case words - look at the top of "common.ini" for "title" strings. You could add an entry for "titleNation" somewhere there.
 
I put it with the others after "TYPE NAME" in a new group called "select storyline", as they all come form the same file. But if you think they fit better with the other titles, I can put them there.
 
One possibility might be to put "periods.c" back to not using "XI_ConvertString"
This was the right call. The specific names of the periods must be already handled somewhere else, becasue removing the 'XI_ConvertString' from periods.c didn't undo the translation. It was only needed for "GetPeriodName(curPeriod)"
 
I put it with the others after "TYPE NAME" in a new group called "select storyline", as they all come form the same file. But if you think they fit better with the other titles, I can put them there.
I'd probably put "Date" and "Period" around there, but put "titleNation" with the other "title" strings. But that's just my preference, yours is just as valid, and the game itself doesn't care as long as the strings are in there somewhere.
 
Ok, this should be it. It includes select_stroyline.c and both Spanish and English common.ini

The strings added are
Code:
;select storyline
string = TitleNation,"NATION"
string = TitlePirateFlag,"PIRATE FLAG"
string = TitlePersonalFlag,"PERSONAL FLAG"
string = TitleProfession,"BACKGROUND PROFESSION"
(the titles other than NATION could have gone with string = PIRATE FLAG,"PIRATE FLAG" as there are no other instance of the phrase but I changed them to the title format for the sake of consistency)
and
Code:
string = Date,"Date"
string = Period,"Period"
string = Flags,"Flags"
string = Navy Assignment,"Navy Assignment"
Both "Flags" and "Navy Assignment" already had TranslateString in place but weren't added to common.ini
 

Attachments

  • SELECT STOYLINE.zip
    63.7 KB · Views: 70
Back
Top