Author Topic: Support for every language (That you can fit in ASCII!)  (Read 15966 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
Does this currently provide a way for different languages to use different sets of fonts? If the FreeSpace font format doesn't support more than 256 characters, then this feature would be needed for a mod to support, say, both German and Russian. Also, I believe the font files included with non-English versions of FS2 are different from the ones in the English version, seeing as how playing the English version in German causes accented letters to display improperly. With this feature, mods could include those those altered fonts specifically for non-English languages.

I didn't include support for that. All I did was expand the existing FS2 system to allow other languages to be used since I now had table files for Spanish. I was waiting for proper support for other fonts to be added before I attempted anything more than that.

I will point out that it would be helpful if I can find someone who has a foreign language version of Freespace 2 who can get me those versions of the files so that I can see the differences.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Support for every language (That you can fit in ASCII!)
I will point out that it would be helpful if I can find someone who has a foreign language version of Freespace 2 who can get me those versions of the files so that I can see the differences.

Getting SCP members access to non-English versions of FS2 would be a great help for internationalisation efforts. I noticed this page @ GOG. Maybe some votes for Freespace 2 would encourage them to add the German/French/Polish versions? (hopefully you could download any language as part of the one purchase)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
Posted a comment on there. I'd appreciate it if someone could get me the file in the meanwhile though. Okay technically I don't own the French or German versions but I bought Freespace 2 three times so it's not like I didn't give :v: their money's worth. :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Re: Support for every language (That you can fit in ASCII!)
Freespace 1 and his extension Silent Threat have French, but not Freespace 2. I bought those games at day one, and Freespace 2 never have French langage for subtitle and voice acting. All the content of Freespace 2 is in english.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
Actually it does have partial French support built in to the engine and also to the table files. Simply edit your registry to have the language set to French instead of English and you'll see what I mean.

If that doesn't work, use a very recent nightly, one from after this was committed.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Re: Support for every language (That you can fit in ASCII!)
Can I edit this value directly into the launcher ? Or I should really go to regedit ?
I'll give you more info this evening.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
The launcher can't edit those values so you do need to use regedit. As I said above, hopefully we'll see this being added to the launcher at a later date.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Re: Support for every language (That you can fit in ASCII!)
Ok, unfortunately, I don't find the key associated to language. Could you tell me what is the key name I have to create and with which type ?


 

Offline Yarn

  • 210
Re: Support for every language (That you can fit in ASCII!)
Ok, unfortunately, I don't find the key associated to language. Could you tell me what is the key name I have to create and with which type ?
The name should be "Language" and the type should be "String Value" or "REG_SZ" (or whatever your version of Windows calls it). Once that's created, set its value to the English name of the language you want (in your case, "French"). I've attached an image of what this should look like.

[attachment deleted by ninja]
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Re: Support for every language (That you can fit in ASCII!)
Ok, now, I reread the whole thread, and I don't know what you want exactly Karajorma ? Do you want a copy of my string.tbl and tstring.tbl ? Or is there some kind of stuff to do with a specific build ?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
Copies of the tables would be useful as I can check them for differences against the ones I have. I'd be interested in seeing if there are any other files which differ in the German, Polish or French versions.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Yarn

  • 210
Re: Support for every language (That you can fit in ASCII!)
I'd be interested in seeing if there are any other files which differ in the German, Polish or French versions.
I made a program with this very goal in mind. The thread is here.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
Thanks, I can see that being very helpful.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Re: Support for every language (That you can fit in ASCII!)
Ok, here the tables:
http://www.mediafire.com/download/a22sa7wtmqfbosy/tables_french.rar

I'll run VPLogger laters since I don't have tangox.vp. I remember I didn't do a full install.

 

Offline Yarn

  • 210
Re: Support for every language (That you can fit in ASCII!)
I got the German version of font01.vf (the only font file that's different); it's in the zip file linked to here at the bottom of the original post. It turns out that, while this font is suitable for German, it's not suitable for English since it messes up the HUD slightly if the game is played in English. Additionally, the German version has a wider kills gauge to fit the longer text.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline Yarn

  • 210
Re: Support for every language (That you can fit in ASCII!)
To help you guys see what characters are in the font files, as well as what the characters' indices are, I have ripped all of the characters from the font files. Here they are:
https://www.dropbox.com/s/3iwoymnmwpg9ydu/fs_font_chars.zip?dl=1

The two versions of font01 are the most important here. In the regular font01 (the English one), you'll notice that all the characters up to index 126 are the ASCII characters. From index 127 onward are special symbols used mainly for the HUD. In the German version of the font (which I named font01-gr), those symbols start at index 164 (the accented characters appear before that). Do 127 and 164 sound familiar to you? That's right, these numbers are the indices defined in localize.cpp and the new language definition structure. They specify the starting index of the special symbols, not the accented characters.

With that in mind, and considering that this feature was only recently committed, I propose renaming "Non-English Character Index" to something like "Special Character Offset" (similar to what it's called in localize.h, line 31) to make it less misleading.


EDIT:
Quote
the extension is used by the game to have extra folders which contain the foreign language files (i.e German voice acting etc.).
This seems to be broken, and it probably always has been. Based on the code and debug messages that I added (patch below), the game appears to apply language extensions in this manner:
Code: [Select]
[original path name]\[language extension]\[original file name]

example: data\voice\special\gr\message.wav

The patch below adds debug messages to the function that I believe is meant to add the language extension. When I tried it, the only messages generated from this that I saw had to do with font files, but the paths were anything but the fonts folder. Change the language setting to German, then try this patch out and then look at the debug log to see what I mean.
Code: [Select]
Index: code/localization/localize.cpp
===================================================================
--- code/localization/localize.cpp (revision 9774)
+++ code/localization/localize.cpp (working copy)
@@ -502,6 +502,7 @@
 // maybe add localized directory to full path with file name when opening a localized file
 int lcl_add_dir_to_path_with_filename(char *current_path, uint path_max)
 {
+ mprintf(("Old path: %s\n", current_path));
  // if the disk extension is 0 length, don't add enything
  if (strlen(Lcl_languages[Lcl_current_lang].lang_ext) <= 0) {
  return 1;
@@ -530,6 +531,7 @@
  strcat_s(current_path, path_max, temp);
 
  delete [] temp;
+ mprintf(("New path: %s\n\n", current_path));
  return 1;
 }
 

« Last Edit: September 15, 2017, 12:38:58 am by Yarn »
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
This is one reason why I wanted the German and French files in the first place. :)

Thanks a lot Yarn, I'll review and add in the changes I can later today.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
This seems to be broken, and it probably always has been. Based on the code and debug messages that I added (patch below), the game appears to apply language extensions in this manner:
Code: [Select]
[original path name]\[language extension]\[original file name]

example: data\voice\special\gr\message.wav

The patch below adds debug messages to the function that I believe is meant to add the language extension. When I tried it, the only messages generated from this that I saw had to do with font files, but the paths were anything but the fonts folder. Change the language setting to German, then try this patch out and then look at the debug log to see what I mean.

The reason for the strange output appears to be that line 389 of font.cpp was set to
Code: [Select]
fp = cfopen( typeface, "rb", CFILE_NORMAL, CF_TYPE_ANY, localize ); instead of
Code: [Select]
fp = cfopen( typeface, "rb", CFILE_NORMAL, CF_TYPE_FONT, localize ); which meant that the game checked all over the place for fonts rather than just in the fonts folder.

Where are the German voice files placed?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Yarn

  • 210
Re: Support for every language (That you can fit in ASCII!)
Where are the German voice files placed?
Do you mean where they are in the German retail version? If so, then they're in the same place as the English voice files (e.g., in-mission voices are in data\voice\special). In fact, no files from the German version are placed in a "gr" folder, even though retail does indeed support this feature, at least for fonts (I tested it recently).
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Support for every language (That you can fit in ASCII!)
Fonts appear to be the only thing it does support actually. I'll see if I can expand that so that it can find German voice files in both data\voice\special and data\voice\special\gr. Doing that with the tables as well would allow you to have a properly multilingual install where the only requirement to switch languages is a change in the registry.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]