Loading of translations is now done in a hierarchical manner. New translations are added to default; you can then specify the language and the locale, and you only need to override the differences.

This commit is contained in:
Wyatt Olson
2010-09-11 20:41:10 -06:00
parent 6505649fff
commit 815d8066cf
27 changed files with 70 additions and 1649 deletions

View File

@@ -21,21 +21,24 @@
#include <string.h>
#include <safegtk.h>
#include <iostream>
MultiLangMgr langMgr;
Glib::ustring M (std::string key) { return langMgr.getStr (key); }
bool MultiLangMgr::load (Glib::ustring fname, MultiLangMgr* fb) {
FILE *f = g_fopen (fname.c_str(), "rt");
fallBack = fb;
FILE *f = g_fopen (fname.c_str(), "rt");
std::cout << "Loading translation " << fname << "\n";
if (f==NULL)
return false;
transTable.clear ();
char* buffer = new char[2048];
while ((buffer = fgets (buffer, 2048, f))) {