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:
@@ -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))) {
|
||||
|
Reference in New Issue
Block a user