about summary refs log tree commit diff
path: root/src/game/localization.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/localization.cpp')
-rw-r--r--src/game/localization.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/game/localization.cpp b/src/game/localization.cpp
index 58ec539c..110a0f5e 100644
--- a/src/game/localization.cpp
+++ b/src/game/localization.cpp
@@ -1,5 +1,6 @@
 
 #include "localization.hpp"
+#include <base/tl/algorithms.hpp>
 
 extern "C" {
 #include <engine/e_linereader.h>
@@ -16,7 +17,6 @@ static unsigned str_hash(const char *str)
 const char *localize(const char *str)
 {
 	const char *new_str = localization.find_string(str_hash(str));
-	//dbg_msg("", "no localization for '%s'", str);
 	return new_str ? new_str : str;
 }
 
@@ -86,15 +86,19 @@ bool LOCALIZATIONDATABASE::load(const char *filename)
 		replacement += 3;
 		localization.add_string(line, replacement);
 	}
-		
+	
 	current_version++;
 	return true;
 }
 
 const char *LOCALIZATIONDATABASE::find_string(unsigned hash)
 {
-	array<STRING>::range r = ::find(strings.all(), hash);
+	STRING s;
+	s.hash = hash;
+	sorted_array<STRING>::range r = ::find_binary(strings.all(), s);
 	if(r.empty())
 		return 0;
 	return r.front().replacement;
 }
+
+LOCALIZATIONDATABASE localization;