polish support again

rraptorr rraptorr at lo2kk.eu.org
Fri May 30 07:24:30 EDT 2003


Hi,
some time ago I sent a patch that added support for Polish version of the
game. After that I was learning for my exams so I didn't have time to do
anything with computer. The patch I'm sending now also adds support for
Polish language, but it it uses language auto detection mechanism.
Again it contains lcl_fix_polish function which converts two Polish
characters (the game seems to convert them to other characters while
reading files, what is strange that it convert only two characters out of
nine). Another small problem is with language auto detection. Polish
version installs font files in directory Data/fonts and the code is
looking for directory Data/Fonts. Because of that it takes fonts from .vp
files and those are English fonts. And then the game bails out. After
changing directory name to Fonts everything works ok (this explains why
some people didn't have Polish character with my previous patch).
Translations were take from the original 3CD Polish version made by CD
Projekt. And this version was tested. It should teoretically work with 1CD
(how they did that?) version which was sold with CD-Action magazine.

Janusz Dziemidowicz
rraptorr at nails.eu.org
-------------- next part --------------
diff -ruN freespace2/include/localize.h freespace2-pl/include/localize.h
--- freespace2/include/localize.h	2002-06-09 06:41:13.000000000 +0200
+++ freespace2-pl/include/localize.h	2003-05-29 15:49:48.000000000 +0200
@@ -60,10 +60,11 @@
 //
 
 // language defines
-#define LCL_NUM_LANGUAGES				3							// keep this up to date
+#define LCL_NUM_LANGUAGES				4							// keep this up to date
 #define LCL_ENGLISH						0
 #define LCL_GERMAN						1
 #define LCL_FRENCH						2
+#define LCL_POLISH						3
 
 #define LCL_DEFAULT_LANGUAGE			LCL_ENGLISH
 
@@ -77,6 +78,7 @@
 // only 1 will be active at a time
 extern int Lcl_fr;
 extern int Lcl_gr;
+extern int Lcl_pl;
 extern int Lcl_english;
 
 
@@ -142,6 +144,9 @@
 #define LCL_TO_ASCII	1
 char* lcl_fix_umlauts(char *str, int which_way);
 
+// covert some polish characters
+void lcl_fix_polish(char *str);
+
 // macro for launcher xstrs
 #if defined(GERMAN_BUILD)
 #define LXSTR(str, i)		(lcl_fix_umlauts(XSTR(str, i), LCL_TO_ANSI))
@@ -152,7 +157,9 @@
 void lcl_translate_wep_name(char *name);
 void lcl_translate_ship_name(char *name);
 void lcl_translate_brief_icon_name(char *name);
+void lcl_translate_brief_icon_name_pl(char *name);
 void lcl_translate_targetbox_name(char *name);
+void lcl_translate_targetbox_name_pl(char *name);
 
 #endif	// defined __FREESPACE2_LOCALIZATION_UTILITIES_HEADER_FILE
 
diff -ruN freespace2/include/medals.h freespace2-pl/include/medals.h
--- freespace2/include/medals.h	2003-05-29 12:23:32.000000000 +0200
+++ freespace2-pl/include/medals.h	2003-05-29 15:49:48.000000000 +0200
@@ -124,6 +124,7 @@
 void blit_text();
 
 void medals_translate_name(char *name, int max_len);
+void medals_translate_name_pl(char *name, int max_len);
 
 #endif
 
diff -ruN freespace2/src/controlconfig/controlsconfigcommon.cpp freespace2-pl/src/controlconfig/controlsconfigcommon.cpp
--- freespace2/src/controlconfig/controlsconfigcommon.cpp	2003-05-29 12:23:32.000000000 +0200
+++ freespace2-pl/src/controlconfig/controlsconfigcommon.cpp	2003-05-29 15:49:48.000000000 +0200
@@ -706,6 +706,57 @@
 	"Button 31",	"Button 32",	"Hat Back",		"Hat Forward",	"Hat Left",		"Hat Right"
 };
 
+char *Scan_code_text_polish[] = {
+	"",				"Esc",			"1",				"2",				"3",				"4",				"5",				"6",
+	"7",				"8",				"9",				"0",				"-",				"=",				"Backspace",	"Tab",
+	"Q",				"W",				"E",				"R",				"T",				"Y",				"U",				"I",
+	"O",				"P",				"[",				"]",				"Enter",			"Lewy Ctrl",	"A",				"S",
+
+	"D",				"F",				"G",				"H",				"J",				"K",				"L",				";",
+	"'",				"`",				"LShift",			"\\",				"Z",				"X",				"C",				"V",
+	"B",				"N",				"M",				",",				".",				"/",				"PShift",			"Num *",
+	"Alt",			"Spacja",		"CapsLock",	"F1",				"F2",				"F3",				"F4",				"F5",
+
+	"F6",				"F7",				"F8",				"F9",				"F10",			"Pause",			"Scrlock",	"Num 7",
+	"Num 8",			"Num 9",			"Num -",			"Num 4",			"Num 5",			"Num 6",			"Num +",			"Num 1",
+	"Num 2",			"Num 3",			"Num 0",			"Num .",			"",				"",				"",				"F11",
+	"F12",			"",				"",				"",				"",				"",				"",				"",
+
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"Num Enter",	"Prawy Ctrl",	"",				"",
+
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"Num /",			"",				"PrntScr",
+	"Alt",			"",				"",				"",				"",				"",				"",				"",
+
+	"",				"",				"",				"",				"",				"Num Lock",		"",				"Home",
+	"Kursor G\xF3ra",		"Page Up",		"",				"Kursor Lewo",	"",				"Kursor Prawo",	"",				"End",
+	"Kursor D\xF3\xB3",  "Page Down",	"Insert",		"Delete",		"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+	"",				"",				"",				"",				"",				"",				"",				"",
+};
+
+char *Joy_button_text_polish[] = {
+	"Przyc.1",		"Przyc.2",		"Przyc.3",		"Przyc.4",		"Przyc.5",		"Przyc.6",
+	"Przyc.7",		"Przyc.8",		"Przyc.9",		"Przyc.10",	"Przyc.11",	"Przyc.12",
+	"Przyc.13",	"Przyc.14",	"Przyc.15",	"Przyc.16",	"Przyc.17",	"Przyc.18",
+	"Przyc.19",	"Przyc.20",	"Przyc.21",	"Przyc.22",	"Przyc.23",	"Przyc.24",
+	"Przyc.25",	"Przyc.26",	"Przyc.27",	"Przyc.28",	"Przyc.29",	"Przyc.30",
+	"Przyc.31",	"Przyc.32",	"Hat Ty\xB3",		"Hat Prz\xF3\x64",	"Hat Lewo",		"Hat Prawo"
+};
+
 char **Scan_code_text = Scan_code_text_english;
 char **Joy_button_text = Joy_button_text_english;
 
@@ -742,6 +793,8 @@
 		max_scan_codes = sizeof(Scan_code_text_german) / sizeof(char *);
 	} else if (Lcl_fr) {
 		max_scan_codes = sizeof(Scan_code_text_french) / sizeof(char *);
+	} else if (Lcl_pl) {
+		max_scan_codes = sizeof(Scan_code_text_polish) / sizeof(char *);
 	} else {
 		max_scan_codes = sizeof(Scan_code_text_english) / sizeof(char *);
 	}
@@ -883,6 +936,9 @@
 	} else if(Lcl_fr){
 		Scan_code_text = Scan_code_text_french;
 		Joy_button_text = Joy_button_text_french;
+	} else if(Lcl_pl){
+		Scan_code_text = Scan_code_text_polish;
+		Joy_button_text = Joy_button_text_polish;
 	} else {
 		Scan_code_text = Scan_code_text_english;
 		Joy_button_text = Joy_button_text_english;
diff -ruN freespace2/src/freespace2/freespace.cpp freespace2-pl/src/freespace2/freespace.cpp
--- freespace2/src/freespace2/freespace.cpp	2003-05-29 12:23:37.000000000 +0200
+++ freespace2-pl/src/freespace2/freespace.cpp	2003-05-29 15:49:48.000000000 +0200
@@ -8840,6 +8840,7 @@
 #endif
 	-1132430286,			// German
 	0,						// French
+	-1131728960,					// Polish
 };
 
 // default setting is "-1" to use config file with English as fall back
diff -ruN freespace2/src/hud/hud.cpp freespace2-pl/src/hud/hud.cpp
--- freespace2/src/hud/hud.cpp	2003-05-29 12:23:37.000000000 +0200
+++ freespace2-pl/src/hud/hud.cpp	2003-05-29 15:49:48.000000000 +0200
@@ -1412,7 +1412,12 @@
 	}
 
 	gr_set_color_fast(&Color_bright_red);
-	gr_printf(Supernova_coords[gr_screen.res][0], Supernova_coords[gr_screen.res][1], "Supernova Warning : %.2f s", time_left);
+	if(Lcl_pl) {
+	    gr_printf(Supernova_coords[gr_screen.res][0], Supernova_coords[gr_screen.res][1], "Wybuch supernowej : %.2f s", time_left);
+	}
+	else {
+	    gr_printf(Supernova_coords[gr_screen.res][0], Supernova_coords[gr_screen.res][1], "Supernova Warning : %.2f s", time_left);
+	}
 }
 
 // render multiplayer ping time to the server if appropriate
diff -ruN freespace2/src/hud/hudtargetbox.cpp freespace2-pl/src/hud/hudtargetbox.cpp
--- freespace2/src/hud/hudtargetbox.cpp	2003-05-29 12:23:39.000000000 +0200
+++ freespace2-pl/src/hud/hudtargetbox.cpp	2003-05-29 15:49:48.000000000 +0200
@@ -432,7 +432,35 @@
 		} else if ( strstr(outstr, "laser") || strstr(outstr, "turret") || strstr(outstr, "missile") ) {
 			strcpy(outstr, "tourelle");
 		} 
-	} else {	
+	} else if(Lcl_pl){	
+		if ( strstr(outstr, "communication") )	{
+			strcpy(outstr, "komunikacja");
+		} else if ( !stricmp(outstr, "weapons") ) {
+			strcpy(outstr, "uzbrojenie");
+		} else if ( strstr(outstr, "engine") || strstr(outstr, "Engine")) {
+			strcpy(outstr, "silnik");
+		} else if ( !stricmp(outstr, "sensors") ) {
+			strcpy(outstr, "sensory");
+		} else if ( strstr(outstr, "navigat") ) {
+			strcpy(outstr, "nawigacja");
+		} else if ( strstr(outstr, "fighterbay") || strstr(outstr, "Fighterbay") ) {
+			strcpy(outstr, "dok my\x9Cliw.");
+		} else if ( strstr(outstr, "missile") ) {
+			strcpy(outstr, "wie\xBF. rakiet.");
+		} else if ( strstr(outstr, "laser") || strstr(outstr, "turret") ) {
+			strcpy(outstr, "wie\xBFyczka");
+		} else if ( strstr(outstr, "Command Tower") || strstr(outstr, "Bridge") ) {
+			strcpy(outstr, "mostek");
+		} else if ( strstr(outstr, "Barracks") ) {
+			strcpy(outstr, "koszary");
+		} else if ( strstr(outstr, "Reactor") ) {
+			strcpy(outstr, "reaktor");
+		} else if ( strstr(outstr, "RadarDish") ) {
+			strcpy(outstr, "antena radaru");
+		} else if (!stricmp(outstr, "Gas Collector")) {
+			strcpy(outstr, "zbieracz gazu");
+		} 
+	} else {
 		if (!strnicmp(outstr, XSTR( "communication", 333), 3))	{
 			strcpy( outstr, XSTR( "comm", 334) );
 		} else if (!strnicmp(outstr, XSTR( "navigation", 335), 3))	{
@@ -943,6 +971,9 @@
 	if (Lcl_gr) {
 		lcl_translate_targetbox_name(outstr);
 	}
+	else if(Lcl_pl) {
+		lcl_translate_targetbox_name_pl(outstr);
+	}
 	emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, outstr);	
 
 	// print out ship class
@@ -962,6 +993,9 @@
 	if (Lcl_gr) {
 		lcl_translate_targetbox_name(temp_name);
 	}
+	else if(Lcl_pl) {
+		lcl_translate_targetbox_name_pl(temp_name);
+	}
 	emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, temp_name);
 
 	ship_integrity = 1.0f;
diff -ruN freespace2/src/localization/localize.cpp freespace2-pl/src/localization/localize.cpp
--- freespace2/src/localization/localize.cpp	2003-05-23 10:23:57.000000000 +0200
+++ freespace2-pl/src/localization/localize.cpp	2003-05-29 15:49:48.000000000 +0200
@@ -314,6 +314,7 @@
 	{ "English",		"" },									// english
 	{ "German",			"gr" },								// german
 	{ "French",			"fr" },								// french
+	{ "Polish",			"pl" },								// polish
 };
 
 //#if defined(GERMAN_BUILD)
@@ -325,6 +326,7 @@
 // following is the offset where special characters start in our font
 #define LCL_SPECIAL_CHARS_FR	164
 #define LCL_SPECIAL_CHARS_GR	164
+#define LCL_SPECIAL_CHARS_PL	127
 #define LCL_SPECIAL_CHARS		127
 int Lcl_special_chars;
 
@@ -332,6 +334,7 @@
 // only 1 will be active at a time
 int Lcl_fr = 0;
 int Lcl_gr = 0 ;
+int Lcl_pl = 0;
 int Lcl_english = 1;
 
 
@@ -529,6 +532,11 @@
 
 			stuff_int(&index);
 			stuff_string(buf, F_NAME, NULL, 4096);
+
+			if(Lcl_pl) {
+			    lcl_fix_polish(buf);
+			}
+
 			i = strlen(buf);
 			while (i--) {
 				if (!isspace(buf[i])) {
@@ -638,6 +646,7 @@
 	// flag the proper language as being active
 	Lcl_fr = 0;
 	Lcl_gr = 0;
+	Lcl_pl = 0;
 	Lcl_english = 0;
 	switch(lang){
 	case LCL_ENGLISH:
@@ -652,6 +661,10 @@
 		Lcl_gr = 1;
 		Lcl_special_chars = LCL_SPECIAL_CHARS_GR;
 		break;
+	case LCL_POLISH:
+		Lcl_pl = 1;
+		Lcl_special_chars = LCL_SPECIAL_CHARS_PL;
+		break;
 	}
 
 	// set to 0, so lcl_ext_open() knows to reset file pointers
@@ -952,6 +965,10 @@
 	// now that we know the boundaries of the actual string in the XSTR() tag. copy it
 	memcpy(out, xstr + str_start, str_end - str_start);	
 
+	if(Lcl_pl) {
+	    lcl_fix_polish(out);
+	}
+
 	// success
 	return 1;
 }
@@ -1395,6 +1412,15 @@
 	return str;
 }
 
+// convert some of the polish characters
+void lcl_fix_polish(char *str)
+{
+    for(;*str;str++) {
+	if(*str == '\xA2') *str = '\xF3';
+	else if(*str == '\x88') *str = '\xEA';
+    }
+}
+
 // ------------------------------------------------------------------
 // lcl_translate_wep_name()
 //
@@ -1561,6 +1587,93 @@
 	}
 }
 
+// ------------------------------------------------------------------
+// lcl_translate_brief_icon_name_pl()
+//
+// For displaying ship names in polish version
+// since we cant actually just change them outright.
+//
+void lcl_translate_brief_icon_name_pl(char *name)
+{
+	char *pos;
+	char buf[128];
+
+	if (!stricmp(name, "Subspace Portal")) {	
+		strcpy(name, "Portal podprz.");
+
+	} else if (!stricmp(name, "Alpha Wing")) {
+		strcpy(name, "Alfa");
+
+	} else if (!stricmp(name, "Beta Wing")) {
+		strcpy(name, "Beta");
+
+	} else if (!stricmp(name, "Zeta Wing")) {
+		strcpy(name, "Zeta");
+
+	} else if (!stricmp(name, "Capella Node")) {
+		strcpy(name, "Capella");
+
+	} else if (!stricmp(name, "Hostile")) {
+		strcpy(name, "Wr\xF3g");
+
+	} else if (!stricmp(name, "Hostile Craft")) {
+		strcpy(name, "Wr\xF3g");
+
+	} else if (!stricmp(name, "Rebel Wing")) {
+		strcpy(name, "Rebelianci");
+
+	} else if (!stricmp(name, "Rebel Fleet")) {
+		strcpy(name, "Flota Rebelii");
+
+	} else if (!stricmp(name, "Sentry Gun")) {
+		strcpy(name, "Dzia\xB3o str.");
+
+	} else if (!stricmp(name, "Cargo")) {
+		strcpy(name, "\xA3\x61\x64unek");
+
+	} else if (!stricmp(name, "Knossos Device")) {
+		strcpy(name, "Urz. Knossos");
+	
+	} else if (!stricmp(name, "Support")) {
+		strcpy(name, "Wsparcie");
+
+	} else if (!stricmp(name, "Unknown")) {
+		strcpy(name, "Nieznany");
+
+	} else if (!stricmp(name, "Instructor")) {
+		strcpy(name, "Instruktor");
+	
+	} else if (!stricmp(name, "Jump Node")) {
+		strcpy(name, "W\xEAze\xB3 skokowy");
+
+	} else if (!stricmp(name, "Escort")) {
+		strcpy(name, "Eskorta");
+
+	} else if (!stricmp(name, "Asteroid Field")) {
+		strcpy(name, "Pole asteroid");
+
+	} else if (!stricmp(name, "Enif Station")) {
+		strcpy(name, "Stacja Enif");
+
+	} else if (!stricmp(name, "Rally Point")) {
+		strcpy(name, "Pkt zborny");
+
+	} else if ((pos = strstr(name, "Transport")) != NULL) {
+		pos += 9;		// strlen of "transport"
+		strcpy(buf, "Transporter");
+		strcat(buf, pos);
+		strcpy(name, buf);
+
+	} else if ((pos = strstr(name, "Jump Node")) != NULL) {
+		pos += 9;		// strlen of "jump node"
+		strcpy(buf, "W\xEAze\xB3 skokowy");
+		strcat(buf, pos);
+		strcpy(name, buf);
+	
+	} else if (!stricmp(name, "Orion under repair")) {
+		strcpy(name, "Naprawiany Orion");
+	}
+}
 
 // ------------------------------------------------------------------
 // lcl_translate_ship_name()
@@ -1627,3 +1740,54 @@
 	}
 }
 
+// ------------------------------------------------------------------
+// lcl_translate_targetbox_name_pl()
+//
+// For displaying ship names in polish version in the targetbox
+// since we cant actually just change them outright.
+//
+void lcl_translate_targetbox_name_pl(char *name)
+{
+	char *pos;
+	char buf[128];
+	
+	if ((pos = strstr(name, "Sentry")) != NULL) {
+		pos += 6;		// strlen of "sentry"
+		strcpy(buf, "Stra\xBFnik");
+		strcat(buf, pos);
+		strcpy(name, buf);
+
+	} else if ((pos = strstr(name, "Support")) != NULL) {
+		pos += 7;		// strlen of "support"
+		strcpy(buf, "Wsparcie");
+		strcat(buf, pos);
+		strcpy(name, buf);
+
+	} else if ((pos = strstr(name, "Unknown")) != NULL) {
+		pos += 7;		// strlen of "unknown"
+		strcpy(buf, "Nieznany");
+		strcat(buf, pos);
+		strcpy(name, buf);
+
+	} else if ((pos = strstr(name, "Drone")) != NULL) {
+		pos += 5;		// strlen of "drone"
+		strcpy(buf, "Sonda");
+		strcat(buf, pos);
+		strcpy(name, buf);
+
+	} else if ((pos = strstr(name, "Jump Node")) != NULL) {
+		pos += 9;		// strlen of "jump node"
+		strcpy(buf, "W\xEAze\xB3 skokowy");
+		strcat(buf, pos);
+		strcpy(name, buf);
+
+	} else if (!stricmp(name, "Instructor")) {
+		strcpy(name, "Instruktor");
+
+	} else if (!stricmp(name, "NTF Vessel")) {
+		strcpy(name, "Okr\xEAt NTF");
+
+	} else if (!stricmp(name, "Enif Station")) {
+		strcpy(name, "Stacja Enif");
+	}
+}
diff -ruN freespace2/src/mission/missionbriefcommon.cpp freespace2-pl/src/mission/missionbriefcommon.cpp
--- freespace2/src/mission/missionbriefcommon.cpp	2003-05-29 12:23:47.000000000 +0200
+++ freespace2-pl/src/mission/missionbriefcommon.cpp	2003-05-29 15:49:48.000000000 +0200
@@ -1238,6 +1238,12 @@
 					lcl_translate_brief_icon_name(buf);
 					gr_get_string_size(&w, &h, buf);
 					gr_printf(bc - fl2i(w/2.0f), by - h, buf);
+				} else if(Lcl_pl) {
+					char buf[128];
+					strcpy(buf, bi->label);
+					lcl_translate_brief_icon_name_pl(buf);
+					gr_get_string_size(&w, &h, buf);
+					gr_printf(bc - fl2i(w/2.0f), by - h, buf);
 				} else {
 					gr_get_string_size(&w,&h,bi->label);
 					gr_printf(bc - fl2i(w/2.0f), by - h, bi->label);
diff -ruN freespace2/src/missionui/missiondebrief.cpp freespace2-pl/src/missionui/missiondebrief.cpp
--- freespace2/src/missionui/missiondebrief.cpp	2003-05-29 12:23:50.000000000 +0200
+++ freespace2-pl/src/missionui/missiondebrief.cpp	2003-05-29 15:49:48.000000000 +0200
@@ -2706,6 +2706,9 @@
 	if (Lcl_gr) {
 		medals_translate_name(Debrief_award_text[Debrief_award_text_num_lines], AWARD_TEXT_MAX_LINE_LENGTH);
 	}
+	else if(Lcl_pl) {
+		medals_translate_name_pl(Debrief_award_text[Debrief_award_text_num_lines], AWARD_TEXT_MAX_LINE_LENGTH);
+	}
 
 	Debrief_award_text_num_lines++;
 
diff -ruN freespace2/src/stats/medals.cpp freespace2-pl/src/stats/medals.cpp
--- freespace2/src/stats/medals.cpp	2003-05-29 12:23:53.000000000 +0200
+++ freespace2-pl/src/stats/medals.cpp	2003-05-29 15:53:03.000000000 +0200
@@ -689,6 +689,66 @@
 #endif
 }
 
+// this is just a hack to display translated names without actually changing the names, 
+// which would break stuff
+void medals_translate_name_pl(char *name, int max_len)
+{
+	if (!strcmp(name, "Epsilon Pegasi Liberation")) {
+		strncpy(name, "Order Wyzwolenia Epsilon Pegasi", max_len);
+
+	} else if (!strcmp(name, "Imperial Order of Vasuda")) {
+		strncpy(name, "Imperialny Order Vasudy", max_len);
+
+	} else if (!strcmp(name, "Distinguished Flying Cross")) {
+		strncpy(name, "Krzy\xBF Wybitnego Pilota", max_len);
+
+	} else if (!strcmp(name, "SOC Service Medallion")) {
+		strncpy(name, "Krzy\xBF S\xB3u\xBF\x62 Specjalnych", max_len);
+
+	} else if (!strcmp(name, "Intelligence Cross")) {
+		strncpy(name, "Krzy\xBF Wywiadu", max_len);
+
+	} else if (!strcmp(name, "Order of Galatea")) {
+		strncpy(name, "Order Galatei", max_len);
+
+	} else if (!strcmp(name, "Meritorious Unit Commendation")) {
+		strncpy(name, "Medal Pochwalny", max_len);
+
+	} else if (!strcmp(name, "Medal of Valor")) {
+		strncpy(name, "Medal za Odwag\xEA", max_len);
+
+	} else if (!strcmp(name, "GTVA Legion of Honor")) {
+		strncpy(name, "Legia Honorowa GTVA", max_len);
+
+	} else if (!strcmp(name, "Allied Defense Citation")) {
+		strncpy(name, "Order za Obron\xEA Sojuszu", max_len);
+
+	} else if (!strcmp(name, "Nebula Campaign Victory Star")) {
+		strncpy(name, "Gwiazda Wiktorii Kampanii w Mg\xB3\x61wicy", max_len);
+
+	} else if (!strcmp(name, "NTF Campaign Victory Star")) {
+		strncpy(name, "Gwiazda Wiktorii Kampanii NTF", max_len);
+
+	} else if (!strcmp(name, "Rank")) {
+		strncpy(name, "Ranga", max_len);
+
+	} else if (!strcmp(name, "Wings")) {
+		strncpy(name, "Skrzyd\xB3\x61", max_len);
+
+	} else if (!strcmp(name, "Ace")) {
+		strncpy(name, "As", max_len);	
+
+	} else if (!strcmp(name, "Double Ace")) {
+		strncpy(name, "Podw\xF3jny As", max_len);
+
+	} else if (!strcmp(name, "Triple Ace")) {
+		strncpy(name, "Potr\xF3jny As", max_len);
+		
+	} else if (!strcmp(name, "SOC Unit Crest")) {
+		strncpy(name, "Tarcza S\xB3u\xBF\x62 Specjalnych", max_len);	
+	}
+}
+
 #ifdef MAKE_FS1
 void blit_label(char *label, int *coordsx, int *coordsy, int num)
 #else
@@ -713,6 +773,17 @@
 		} else {
 			sprintf( text, "%s", translated_label );
 		}
+	} else if(Lcl_pl) {
+		char translated_label[256];
+		strncpy(translated_label, label, 256);
+		medals_translate_name_pl(translated_label, 256);
+
+		// set correct string
+		if ( num > 1 ) {
+			sprintf( text, NOX("%s (%d)"), translated_label, num );
+		} else {
+			sprintf( text, "%s", translated_label );
+		}
 	} else {
 		// set correct string
 		if ( num > 1 ) {


More information about the freespace2 mailing list