mirror of
https://github.com/glest/glest-source.git
synced 2025-08-18 22:21:18 +02:00
- added missing translation strings to spanish (used bablefish for translations)
- updated exit text to support newlines in language text - added support for netwlines in language string code
This commit is contained in:
@@ -72,7 +72,9 @@ void Lang::loadScenarioStrings(const string &scenarioDir, const string &scenario
|
|||||||
|
|
||||||
string Lang::get(const string &s){
|
string Lang::get(const string &s){
|
||||||
try{
|
try{
|
||||||
return strings.getString(s);
|
string result = strings.getString(s);
|
||||||
|
replaceAll(result, "\\n", "\n");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
catch(exception &){
|
catch(exception &){
|
||||||
return "???" + s + "???";
|
return "???" + s + "???";
|
||||||
|
@@ -448,6 +448,10 @@ int glestMain(int argc, char** argv){
|
|||||||
//throw runtime_error("test!");
|
//throw runtime_error("test!");
|
||||||
//ExceptionHandler::DisplayMessage("test!", false);
|
//ExceptionHandler::DisplayMessage("test!", false);
|
||||||
|
|
||||||
|
//Lang &lang= Lang::getInstance();
|
||||||
|
//string test = lang.get("ExitGameServer?");
|
||||||
|
//printf("[%s]",test.c_str());
|
||||||
|
|
||||||
//main loop
|
//main loop
|
||||||
while(Window::handleEvent()){
|
while(Window::handleEvent()){
|
||||||
program->loop();
|
program->loop();
|
||||||
|
@@ -122,6 +122,8 @@ void restoreVideoMode(bool exitingApp=false);
|
|||||||
|
|
||||||
bool EndsWith(const string &str, const string& key);
|
bool EndsWith(const string &str, const string& key);
|
||||||
|
|
||||||
|
string replaceAll(string& context, const string& from, const string& to);
|
||||||
|
|
||||||
int getScreenW();
|
int getScreenW();
|
||||||
int getScreenH();
|
int getScreenH();
|
||||||
|
|
||||||
|
@@ -831,6 +831,16 @@ bool isKeyDown(int virtualKey) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string replaceAll(string& context, const string& from, const string& to) {
|
||||||
|
size_t lookHere = 0;
|
||||||
|
size_t foundHere;
|
||||||
|
while((foundHere = context.find(from, lookHere)) != string::npos) {
|
||||||
|
context.replace(foundHere, from.size(), to);
|
||||||
|
lookHere = foundHere + to.size();
|
||||||
|
}
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
// =====================================
|
// =====================================
|
||||||
// ModeInfo
|
// ModeInfo
|
||||||
// =====================================
|
// =====================================
|
||||||
|
Reference in New Issue
Block a user