#include "rldefine.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <windows.h>
#include "rlinifile.h"
#include "rlcutil.h"
Go to the source code of this file.
|
int | rlSetTranslator (const char *language, const char *inifile) |
|
static const char * | fixquote (const char *text, char **mytext) |
|
const char * | rltranslate (const char *txt, char **mytext) |
|
const char * | rltranslate2 (const char *section, const char *txt, char **mytext) |
|
◆ fixquote()
static const char* fixquote |
( |
const char * |
text, |
|
|
char ** |
mytext |
|
) |
| |
|
static |
Definition at line 523 of file rlinifile.cpp.
525 if(strchr(text,
'\\') == NULL)
return text;
526 int len = strlen(text);
527 if(*mytext != NULL)
delete [] *mytext;
528 *mytext =
new char[len+1];
529 char *temp = *mytext;
531 for(
int i=0; i<len; i++)
533 if (text[i] ==
'\\' && text[i+1] ==
'=') { temp[i2] =
'='; i++; }
534 else if(text[i] ==
'\\' && text[i+1] ==
'n') { temp[i2] =
'\n'; i++; }
535 else if(text[i] ==
'\\' && text[i+1] ==
't') { temp[i2] =
'\t'; i++; }
536 else if(text[i] ==
'\\' && text[i+1] ==
'\\') { temp[i2] =
'\\'; i++; }
537 else { temp[i2] = text[i]; }
◆ rlSetTranslator()
int rlSetTranslator |
( |
const char * |
language, |
|
|
const char * |
inifile |
|
) |
| |
Definition at line 512 of file rlinifile.cpp.
static rlIniFile * trIniFile
int read(const char *filename)
void setDefaultSection(const char *section)
◆ rltranslate()
const char* rltranslate |
( |
const char * |
txt, |
|
|
char ** |
mytext |
|
) |
| |
Definition at line 545 of file rlinifile.cpp.
549 if(strcmp(text,
"@") == 0)
return fixquote(txt,mytext);
static rlIniFile * trIniFile
const char * i18n(const char *tag, const char *default_text="")
static const char * fixquote(const char *text, char **mytext)
◆ rltranslate2()
const char* rltranslate2 |
( |
const char * |
section, |
|
|
const char * |
txt, |
|
|
char ** |
mytext |
|
) |
| |
Definition at line 553 of file rlinifile.cpp.
557 if(*section ==
'\0')
return rltranslate(txt,mytext);
559 if(text[0] ==
'\0')
return fixquote(txt,mytext);
static rlIniFile * trIniFile
const char * text(const char *section, const char *name)
const char * rltranslate(const char *txt, char **mytext)
static const char * fixquote(const char *text, char **mytext)
◆ null_string
const char null_string[] = "" |
|
static |
◆ trIniFile