about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/menus.cpp29
-rw-r--r--src/game/client/components/menus_browser.cpp3
-rw-r--r--src/game/client/components/menus_settings.cpp49
3 files changed, 28 insertions, 53 deletions
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp
index 398bd1ae..932597f7 100644
--- a/src/game/client/components/menus.cpp
+++ b/src/game/client/components/menus.cpp
@@ -12,9 +12,7 @@
 #include "skins.hpp"
 
 #include <engine/e_client_interface.h>
-extern "C" {
-#include <engine/e_linereader.h>
-}
+
 #include <game/version.hpp>
 #include <game/generated/g_protocol.hpp>
 
@@ -622,32 +620,7 @@ void MENUS::render_news(RECT main_view)
 
 void MENUS::on_init()
 {
-	LINEREADER lr;
-	IOHANDLE io = io_open("swedish.txt", IOFLAG_READ);
-	linereader_init(&lr, io);
-	char *line;
-	while((line = linereader_get(&lr)))
-	{
-		if(!str_length(line))
-			continue;
-			
-		char *replacement = linereader_get(&lr);
-		if(!replacement)
-		{
-			dbg_msg("", "unexpected end of file");
-			break;
-		}
-		
-		if(replacement[0] != '=' || replacement[1] != '=' || replacement[2] != ' ')
-		{
-			dbg_msg("", "malform replacement line for '%s'", line);
-			continue;
-		}
 
-		replacement += 3;
-		localization.add_string(line, replacement);
-	}
-	
 	/*
 	array<string> my_strings;
 	array<string>::range r2;
diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp
index a7751347..3d58af93 100644
--- a/src/game/client/components/menus_browser.cpp
+++ b/src/game/client/components/menus_browser.cpp
@@ -9,6 +9,7 @@
 #include <game/client/ui.hpp>
 #include <game/client/render.hpp>
 #include "menus.hpp"
+#include <game/localization.hpp>
 #include <game/version.hpp>
 
 void MENUS::render_serverbrowser_serverlist(RECT view)
@@ -27,7 +28,7 @@ void MENUS::render_serverbrowser_serverlist(RECT view)
 	{
 		int id;
 		int sort;
-		const char *caption;
+		LOC_CONSTSTRING caption;
 		int direction;
 		float width;
 		int flags;
diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp
index beeab046..58678b80 100644
--- a/src/game/client/components/menus_settings.cpp
+++ b/src/game/client/components/menus_settings.cpp
@@ -13,6 +13,7 @@
 #include <game/client/render.hpp>
 #include <game/client/gameclient.hpp>
 #include <game/client/animstate.hpp>
+#include <game/localization.hpp>
 
 #include "binds.hpp"
 #include "menus.hpp"
@@ -248,35 +249,35 @@ typedef void (*assign_func_callback)(CONFIGURATION *config, int value);
 
 typedef struct 
 {
-	const char *name;
+	LOC_CONSTSTRING name;
 	const char *command;
 	int keyid;
 } KEYINFO;
 
-// TODO: localize
 KEYINFO keys[] = 
 {
-	{ "Move Left:", "+left", 0},
-	{ "Move Right:", "+right", 0 },
-	{ "Jump:", "+jump", 0 },
-	{ "Fire:", "+fire", 0 },
-	{ "Hook:", "+hook", 0 },
-	{ "Hammer:", "+weapon1", 0 },
-	{ "Pistol:", "+weapon2", 0 },
-	{ "Shotgun:", "+weapon3", 0 },
-	{ "Grenade:", "+weapon4", 0 },
-	{ "Rifle:", "+weapon5", 0 },
-	{ "Next Weapon:", "+nextweapon", 0 },
-	{ "Prev. Weapon:", "+prevweapon", 0 },
-	{ "Vote Yes:", "vote yes", 0 },
-	{ "Vote No:", "vote no", 0 },
-	{ "Chat:", "chat all", 0 },
-	{ "Team Chat:", "chat team", 0 },
-	{ "Emoticon:", "+emote", 0 },
-	{ "Console:", "toggle_local_console", 0 },
-	{ "Remote Console:", "toggle_remote_console", 0 },
-	{ "Screenshot:", "screenshot", 0 },
-	{ "Scoreboard:", "+scoreboard", 0 },
+	// we need to do localize so the scripts can pickup the string
+	{ localize("Move Left:"), "+left", 0},
+	{ localize("Move Right:"), "+right", 0 },
+	{ localize("Jump:"), "+jump", 0 },
+	{ localize("Fire:"), "+fire", 0 },
+	{ localize("Hook:"), "+hook", 0 },
+	{ localize("Hammer:"), "+weapon1", 0 },
+	{ localize("Pistol:"), "+weapon2", 0 },
+	{ localize("Shotgun:"), "+weapon3", 0 },
+	{ localize("Grenade:"), "+weapon4", 0 },
+	{ localize("Rifle:"), "+weapon5", 0 },
+	{ localize("Next Weapon:"), "+nextweapon", 0 },
+	{ localize("Prev. Weapon:"), "+prevweapon", 0 },
+	{ localize("Vote Yes:"), "vote yes", 0 },
+	{ localize("Vote No:"), "vote no", 0 },
+	{ localize("Chat:"), "chat all", 0 },
+	{ localize("Team Chat:"), "chat team", 0 },
+	{ localize("Emoticon:"), "+emote", 0 },
+	{ localize("Console:"), "toggle_local_console", 0 },
+	{ localize("Remote Console:"), "toggle_remote_console", 0 },
+	{ localize("Screenshot:"), "screenshot", 0 },
+	{ localize("Scoreboard:"), "+scoreboard", 0 },
 };
 
 const int key_count = sizeof(keys) / sizeof(KEYINFO);
@@ -292,7 +293,7 @@ void MENUS::ui_do_getbuttons(int start, int stop, RECT view)
 	
 		ui_do_label(&label, key.name, 14.0f, -1);
 		int oldid = key.keyid;
-		int newid = ui_do_key_reader((void *)keys[i].name, &button, oldid);
+		int newid = ui_do_key_reader((void *)&keys[i].name, &button, oldid);
 		if(newid != oldid)
 		{
 			gameclient.binds->bind(oldid, "");