mirror of
https://github.com/anope/anope.git
synced 2026-07-06 21:03:13 +02:00
BUILD : 1.7.14 (1112) BUGS : 565 NOTES : %M will now be replaced by either /msg or / depending on UseStrictPrivMsg - we still need to update the .l files for all langauges tho.
git-svn-id: svn://svn.anope.org/anope/trunk@1112 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@836 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
d61eebd738
commit
863f7fdb6d
@@ -149,6 +149,30 @@ static void load_lang(int index, const char *filename)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* Replace all %M's with "/msg " or "/" */
|
||||
void lang_sanitize()
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
int len = 0;
|
||||
char buf[256];
|
||||
for (i = 0; i < NUM_LANGS; i++) {
|
||||
for (j = 0; j < NUM_STRINGS; j++) {
|
||||
if (strstr(langtexts[i][j], "%M")) {
|
||||
len = strlen(langtexts[i][j]);
|
||||
if (UseStrictPrivMsg) {
|
||||
langtexts[i][j] =
|
||||
strnrepl(langtexts[i][j], len, "%M", "/");
|
||||
} else {
|
||||
langtexts[i][j] = realloc(langtexts[i][j], len + 5);
|
||||
langtexts[i][j] =
|
||||
strnrepl(langtexts[i][j], len + 5, "%M", "/msg ");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Initialize list of lists. */
|
||||
|
||||
void lang_init()
|
||||
@@ -198,6 +222,7 @@ void lang_init()
|
||||
if (!langtexts[i])
|
||||
langtexts[i] = langtexts[DEF_LANGUAGE];
|
||||
}
|
||||
lang_sanitize();
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user