using $b, $k for formating purposes - don't use \002, \003 anymore
authorpk910 <philipp@zoelle1.de>
Mon, 19 Sep 2011 01:05:39 +0000 (03:05 +0200)
committerpk910 <philipp@zoelle1.de>
Mon, 19 Sep 2011 01:34:05 +0000 (03:34 +0200)
bot_NeonServ.c
lang.c
modcmd.c

index f3448ac239a41d227f8b5b7828ecb01d4b8ed0b2..18b35406db4fcda8acfb7f8a868fa15d19a46ed0 100644 (file)
 #define BOTID 1
 
 static const struct default_language_entry msgtab[] = {
-    {"NS_USER_UNKNOWN", "User with nick \002%s\002 does not exist."}, /* {ARGS: "TestUser"} */
-    {"NS_AUTH_UNKNOWN", "Account \002%s\002 has not been registered."}, /* {ARGS: "TestAuth"} */
-    {"NS_USER_NEED_AUTH", "%s must first authenticate with \002AuthServ\002."}, /* {ARGS: "TestUser"} */
-    {"NS_YOU_NEED_AUTH", "You must first authenticate with \002AuthServ\002."},
-    {"NS_INVALID_ACCESS", "\002%d\002 is an invalid access level."}, /* {ARGS: 1337} */
-    {"NS_ADDUSER_ALREADY_ADDED", "%s is already on the \002%s\002 user list (with access %d)."}, /* {ARGS: "TestUser", "#TestChan", 123} */
+    {"NS_USER_UNKNOWN", "User with nick $b%s$b does not exist."}, /* {ARGS: "TestUser"} */
+    {"NS_AUTH_UNKNOWN", "Account $b%s$b has not been registered."}, /* {ARGS: "TestAuth"} */
+    {"NS_USER_NEED_AUTH", "%s must first authenticate with $bAuthServ$b."}, /* {ARGS: "TestUser"} */
+    {"NS_YOU_NEED_AUTH", "You must first authenticate with $bAuthServ$b."},
+    {"NS_INVALID_ACCESS", "$b%d$b is an invalid access level."}, /* {ARGS: 1337} */
+    {"NS_ADDUSER_ALREADY_ADDED", "%s is already on the $b%s$b user list (with access %d)."}, /* {ARGS: "TestUser", "#TestChan", 123} */
     {"NS_ADDUSER_DONE", "Added %s to the %s user list with access %d."}, /* {ARGS: "TestUser", "#TestChan", 123} */
-    {"NS_NOT_ON_USERLIST", "%s lacks access to \002%s\002."}, /* {ARGS: "TestUser", "#TestChan"} */
-    {"NS_NOT_ON_USERLIST_YOU", "You lack access to \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_NOT_ON_CHANNEL", "%s isn't currently in \002%s\002."}, /* {ARGS: "TestUser", "#TestChan"} */
-    {"NS_NOT_ON_CHANNEL_YOU", "You aren't currently in \002%s\002."}, /* {ARGS: "#TestChan"} */
+    {"NS_NOT_ON_USERLIST", "%s lacks access to $b%s$b."}, /* {ARGS: "TestUser", "#TestChan"} */
+    {"NS_NOT_ON_USERLIST_YOU", "You lack access to $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_NOT_ON_CHANNEL", "%s isn't currently in $b%s$b."}, /* {ARGS: "TestUser", "#TestChan"} */
+    {"NS_NOT_ON_CHANNEL_YOU", "You aren't currently in $b%s$b."}, /* {ARGS: "#TestChan"} */
     {"NS_DELUSER_DONE", "Deleted %s (with access %d) from the %s user list."}, /* {ARGS: "TestUser", 123, "#TestChan"} */
     {"NS_ACCESS_OUTRANKED", "You cannot give users access greater than or equal to your own."},
-    {"NS_USER_OUTRANKED", "\002%s\002 outranks you (command has no effect)."}, /* {ARGS: "TestUser"} */
+    {"NS_USER_OUTRANKED", "$b%s$b outranks you (command has no effect)."}, /* {ARGS: "TestUser"} */
     {"NS_ACCESS_DENIED", "Access denied."},
     {"NS_NO_ACCESS", "You lack sufficient access to use this command."},
-    {"NS_USER_PROTECTED", "Sorry, \002%s\002 is protected."}, /* {ARGS: "TestUser"} */
-    {"NS_SERVICE_IMMUNE", "\002%s\002 may not be kicked, killed, banned, or deopped."}, /* {ARGS: "TestUser"} */
+    {"NS_USER_PROTECTED", "Sorry, $b%s$b is protected."}, /* {ARGS: "TestUser"} */
+    {"NS_SERVICE_IMMUNE", "$b%s$b may not be kicked, killed, banned, or deopped."}, /* {ARGS: "TestUser"} */
     {"NS_TABLE_NONE", "   None"},
-    {"NS_TABLE_COUNT", "Found \002%d\002 matches."}, /* {ARGS: 5} */
-    {"NS_BAN_ALREADY_ADDED", "\002%s\002 is already banned in %s."}, /* {ARGS: "*!*@moeeep.*", "#TestChan"} */
+    {"NS_TABLE_COUNT", "Found $b%d$b matches."}, /* {ARGS: 5} */
+    {"NS_BAN_ALREADY_ADDED", "$b%s$b is already banned in %s."}, /* {ARGS: "*!*@moeeep.*", "#TestChan"} */
     {"NS_INVALID_ACCESS_RANGE", "Invalid access range; minimum (%d) must be lower than maximum (%d)."}, /* {ARGS: 450, 400} */
-    {"NS_CLVL_DONE", "%s now has access \002%d\002 in %s."}, /* {ARGS: "TestUser", 123, "#TestChan"} */
-    {"NS_A_LACKS_ACCESS_BUT_GOD_NICK", "%s lacks access to %s but has \002security override\002 enabled."}, /* {ARGS: "TestAuth", "#TestChan"} */
-    {"NS_A_LACKS_ACCESS_BUT_GOD_AUTH", "%s (%s) lacks access to %s but has \002security override\002 enabled."}, /* {ARGS: "TestAuth", "TestUser", "#TestChan"} */
-    {"NS_A_ACCESS_NICK", "%s has access \002%d\002 in %s."}, /* {ARGS: "TestAuth", 123, "#TestChan"} */
-    {"NS_A_ACCESS_AUTH", "%s (%s) has access \002%d\002 in %s."}, /* {ARGS: "TestAuth", "TestUser", 123, "#TestChan"} */
-    {"NS_A_ACCESS_NICK_GOD", "%s has access \002%d\002 in %s and has \002security override\002 enabled."}, /* {ARGS: "TestAuth", 123, "#TestChan"} */
-    {"NS_A_ACCESS_AUTH_GOD", "%s (%s) has access \002%d\002 in %s and has \002security override\002 enabled."}, /* {ARGS: "TestAuth", "TestUser", 123, "#TestChan"} */
-    {"NS_A_SUSPENDED", "\002%s\002's access to %s has been suspended."}, /* {ARGS: "TestAuth", "#TestChan"} */
-    {"NS_A_IS_IRCOP", "%s is an \002IRC operator\002."}, /* {ARGS: "TestUser", "#TestChan"} */
+    {"NS_CLVL_DONE", "%s now has access $b%d$b in %s."}, /* {ARGS: "TestUser", 123, "#TestChan"} */
+    {"NS_A_LACKS_ACCESS_BUT_GOD_NICK", "%s lacks access to %s but has $bsecurity override$b enabled."}, /* {ARGS: "TestAuth", "#TestChan"} */
+    {"NS_A_LACKS_ACCESS_BUT_GOD_AUTH", "%s (%s) lacks access to %s but has $bsecurity override$b enabled."}, /* {ARGS: "TestAuth", "TestUser", "#TestChan"} */
+    {"NS_A_ACCESS_NICK", "%s has access $b%d$b in %s."}, /* {ARGS: "TestAuth", 123, "#TestChan"} */
+    {"NS_A_ACCESS_AUTH", "%s (%s) has access $b%d$b in %s."}, /* {ARGS: "TestAuth", "TestUser", 123, "#TestChan"} */
+    {"NS_A_ACCESS_NICK_GOD", "%s has access $b%d$b in %s and has $bsecurity override$b enabled."}, /* {ARGS: "TestAuth", 123, "#TestChan"} */
+    {"NS_A_ACCESS_AUTH_GOD", "%s (%s) has access $b%d$b in %s and has $bsecurity override$b enabled."}, /* {ARGS: "TestAuth", "TestUser", 123, "#TestChan"} */
+    {"NS_A_SUSPENDED", "$b%s$b's access to %s has been suspended."}, /* {ARGS: "TestAuth", "#TestChan"} */
+    {"NS_A_IS_IRCOP", "%s is an $bIRC operator$b."}, /* {ARGS: "TestUser", "#TestChan"} */
     {"NS_USERS_HEADER", "%s users from level %d to %d:"}, /* {ARGS: "#TestChan", 1, 500} */
     {"NS_USERS_HEADER_MATCH", "%s users from level %d to %d matching %s:"}, /* {ARGS: "#TestChan", 1, 500, "Test*"} */
     {"NS_USERS_HEADER_ACCESS", "Access"},
     {"NS_USERS_HEADER_ACCOUNT", "Accout"},
     {"NS_USERS_HEADER_SEEN", "Last Seen"},
     {"NS_USERS_HEADER_STATE", "Status"},
-    {"NS_USERS_COUNT", "There are \002%d\002 users in %s."}, /* {ARGS: 20, "#TestChan"} */
-    {"NS_USERS_COUNT_1", "There is \002%d\002 user in %s."}, /* {ARGS: 1, "#TestChan"} */
-    {"NS_USERS_COUNT_MATCH", "There are \002%d\002 users in %s. (\002%d\002 matching your request)"}, /* {ARGS: 20, "#TestChan", 5} */
-    {"NS_USERS_COUNT_MATCH_1", "There is \002%d\002 user in %s. (\002%d\002 matching your request)"}, /* {ARGS: 1, "#TestChan", 1} */
+    {"NS_USERS_COUNT", "There are $b%d$b users in %s."}, /* {ARGS: 20, "#TestChan"} */
+    {"NS_USERS_COUNT_1", "There is $b%d$b user in %s."}, /* {ARGS: 1, "#TestChan"} */
+    {"NS_USERS_COUNT_MATCH", "There are $b%d$b users in %s. ($b%d$b matching your request)"}, /* {ARGS: 20, "#TestChan", 5} */
+    {"NS_USERS_COUNT_MATCH_1", "There is $b%d$b user in %s. ($b%d$b matching your request)"}, /* {ARGS: 1, "#TestChan", 1} */
     {"NS_USERS_SEEN_HERE", "Here"},
     {"NS_USERS_SEEN_INVISIBLE", "Here (invisible)"},
     {"NS_USERS_SEEN_NEVER", "Never"},
     {"NS_USERS_STATE_SUSPENDED", "Suspended"},
     {"NS_USERS_STATE_NORMAL", "Normal"},
-    {"NS_SUSPEND_ALREADY", "\002%s\002 is already suspended." }, /* {ARGS: "TestUser"} */
-    {"NS_SUSPEND_NOT", "\002%s\002 is not suspended." }, /* {ARGS: "TestUser"} */
-    {"NS_SUSPEND_DONE", "\002%s\002's access to \002%s\002 has been suspended." }, /* {ARGS: "TestUser", "#TestChan"} */
-    {"NS_SUSPEND_RESTORED", "\002%s\002's access to \002%s\002 has been restored." }, /* {ARGS: "TestUser", "#TestChan"} */
+    {"NS_SUSPEND_ALREADY", "$b%s$b is already suspended." }, /* {ARGS: "TestUser"} */
+    {"NS_SUSPEND_NOT", "$b%s$b is not suspended." }, /* {ARGS: "TestUser"} */
+    {"NS_SUSPEND_DONE", "$b%s$b's access to $b%s$b has been suspended." }, /* {ARGS: "TestUser", "#TestChan"} */
+    {"NS_SUSPEND_RESTORED", "$b%s$b's access to $b%s$b has been restored." }, /* {ARGS: "TestUser", "#TestChan"} */
     {"NS_DELME_KEY", "To really remove yourself, you must use 'deleteme %s'."}, /* {ARGS: "abc123"} */
-    {"NS_DELME_DONE", "Your \002%d\002 access has been deleted from \002%s\002."}, /* {ARGS: 123, "#TestChan"} */
-    {"NS_MYACCESS_HEADER", "Showing all channel entries for account \002%s\002:"}, /* {ARGS: "TestAuth"} */
-    {"NS_MYACCESS_HEADER_MATCH", "Showing all channel entries for account \002%s\002 matching %s:"}, /* {ARGS: "TestAuth", "#Test*"} */
+    {"NS_DELME_DONE", "Your $b%d$b access has been deleted from $b%s$b."}, /* {ARGS: 123, "#TestChan"} */
+    {"NS_MYACCESS_HEADER", "Showing all channel entries for account $b%s$b:"}, /* {ARGS: "TestAuth"} */
+    {"NS_MYACCESS_HEADER_MATCH", "Showing all channel entries for account $b%s$b matching %s:"}, /* {ARGS: "TestAuth", "#Test*"} */
     {"NS_MYACCESS_HEADER_NAME", "Name"},
     {"NS_MYACCESS_HEADER_ACCESS", "Access"},
     {"NS_MYACCESS_HEADER_FLAGS", "Flags"},
     {"NS_MYACCESS_HEADER_INFO", "Info"},
-    {"NS_MYACCESS_COUNT", "%s has access in \002%d\002 channel(s) and is owner of \002%d\002 channel(s)."}, /* {ARGS: "TestUser", 15, 5} */
-    {"NS_MYACCESS_COUNT_MATCH", "%s has access in \002%d\002 channel(s) and is owner of \002%d\002 channel(s) (\002%d\002 channels matching your request)."}, /* {ARGS: "TestUser", 15, 5, 7} */
-    {"NS_UP_ALREADY_OP", "You are already opped in \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_UP_ALREADY_VOICE", "You are already voiced in \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_DOWN_ALREADY", "You are not opped or voiced in \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_MDELUSER_DONE", "Deleted \002%d\002 account(s) matching \002%s\002 with access from \002%d\002 to \002%d\002 from the %s user list."}, /* {ARGS: 10, "Test*", 1, 200, "#TestChan"} */
+    {"NS_MYACCESS_COUNT", "%s has access in $b%d$b channel(s) and is owner of $b%d$b channel(s)."}, /* {ARGS: "TestUser", 15, 5} */
+    {"NS_MYACCESS_COUNT_MATCH", "%s has access in $b%d$b channel(s) and is owner of $b%d$b channel(s) ($b%d$b channels matching your request)."}, /* {ARGS: "TestUser", 15, 5, 7} */
+    {"NS_UP_ALREADY_OP", "You are already opped in $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_UP_ALREADY_VOICE", "You are already voiced in $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_DOWN_ALREADY", "You are not opped or voiced in $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_MDELUSER_DONE", "Deleted $b%d$b account(s) matching $b%s$b with access from $b%d$b to $b%d$b from the %s user list."}, /* {ARGS: 10, "Test*", 1, 200, "#TestChan"} */
     {"NS_TRIM_DURATION_TOO_SHORT", "You must include a minimum inactivity duration of at least %d seconds to trim."},
-    {"NS_TRIM_DONE", "Trimmed \002%d users\002 with access from %d to %d from the %s user list who were inactive for at least %s."}, /* {ARGS: 10, 1, 100, "#TestChan", "10 days"} */
+    {"NS_TRIM_DONE", "Trimmed $b%d users$b with access from %d to %d from the %s user list who were inactive for at least %s."}, /* {ARGS: 10, 1, 100, "#TestChan", "10 days"} */
     {"NS_GIVEOWNER_SELF", "You cannot give ownership to your own account."},
-    {"NS_GIVEOWNER_TIMEOUT", "You must wait %s before you can give ownership of \002%s\002 to someone else."}, /* {ARGS: "5 hours", "#TestChan"} */
-    {"NS_GIVEOWNER_CONFIRM", "To really give ownership to \002%1$s\002, you must use 'giveownership *%1$s %2$s'."}, /* {ARGS: "TestUser", "abc123"} */
-    {"NS_GIVEOWNER_DONE", "Ownership of \002%s\002 has been transferred to account \002%s\002."}, /* {ARGS: "#TestChan", "TestUser"} */
-    {"NS_OP_FAIL", "\002%s\002 could not op some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
-    {"NS_OP_DONE", "Opped users in \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_VOICE_FAIL", "\002%s\002 could not voice some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
-    {"NS_VOICE_DONE", "Voiced users in \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_DEOP_FAIL", "\002%s\002 could not deop some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
-    {"NS_DEOP_DONE", "Deopped users in \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_DEVOICE_FAIL", "\002%s\002 could not devoice some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
-    {"NS_DEVOICE_DONE", "Devoiced users in \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_OPALL_SECURITY", "\002WARNING\002: Opping all users on a channel is very insecure! If you still want do op all users on %s use: '\002opall FORCE\002 [nick mask]'"},
-    {"NS_OPALL_DONE", "Opped \002%d\002 users in %s."}, /* {ARGS: 20, "#TestChan"} */
-    {"NS_VOICEALL_DONE", "Voiced \002%d\002 users in %s."}, /* {ARGS: 20, "#TestChan"} */
-    {"NS_DEOPALL_DONE", "Deopped \002%d\002 users in %s."}, /* {ARGS: 20, "#TestChan"} */
-    {"NS_DEVOICEALL_DONE", "Devoiced \002%d\002 users in %s."}, /* {ARGS: 20, "#TestChan"} */
-    {"NS_KICK_DONE", "Kicked \002%d\002 users from %s"}, /* {ARGS: 20, "#TestChan"} */
-    {"NS_KICK_FAIL", "\002%s\002 could not kick some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
-    {"NS_KICKBAN_DONE", "KickBanned \002%d\002 users from %s"}, /* {ARGS: 10, "#TestChan"} */
-    {"NS_KICKBAN_FAIL", "\002%s\002 could not kickban some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
-    {"NS_BAN_DONE", "\002%d\002 masks added to the %s ban list. (matching %d users)"}, /* {ARGS: 5, "#TestChan", 15} */
-    {"NS_BAN_FAIL", "\002%s\002 could not kickban some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
-    {"NS_LAME_MASK", "\002%s\002 is a little too general. Try making it more specific."}, /* {ARGS: "*!*@*"} */
+    {"NS_GIVEOWNER_TIMEOUT", "You must wait %s before you can give ownership of $b%s$b to someone else."}, /* {ARGS: "5 hours", "#TestChan"} */
+    {"NS_GIVEOWNER_CONFIRM", "To really give ownership to $b%1$s$b, you must use 'giveownership *%1$s %2$s'."}, /* {ARGS: "TestUser", "abc123"} */
+    {"NS_GIVEOWNER_DONE", "Ownership of $b%s$b has been transferred to account $b%s$b."}, /* {ARGS: "#TestChan", "TestUser"} */
+    {"NS_OP_FAIL", "$b%s$b could not op some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
+    {"NS_OP_DONE", "Opped users in $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_VOICE_FAIL", "$b%s$b could not voice some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
+    {"NS_VOICE_DONE", "Voiced users in $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_DEOP_FAIL", "$b%s$b could not deop some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
+    {"NS_DEOP_DONE", "Deopped users in $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_DEVOICE_FAIL", "$b%s$b could not devoice some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
+    {"NS_DEVOICE_DONE", "Devoiced users in $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_OPALL_SECURITY", "$bWARNING$b: Opping all users on a channel is very insecure! If you still want do op all users on %s use: '$bopall FORCE$b [nick mask]'"},
+    {"NS_OPALL_DONE", "Opped $b%d$b users in %s."}, /* {ARGS: 20, "#TestChan"} */
+    {"NS_VOICEALL_DONE", "Voiced $b%d$b users in %s."}, /* {ARGS: 20, "#TestChan"} */
+    {"NS_DEOPALL_DONE", "Deopped $b%d$b users in %s."}, /* {ARGS: 20, "#TestChan"} */
+    {"NS_DEVOICEALL_DONE", "Devoiced $b%d$b users in %s."}, /* {ARGS: 20, "#TestChan"} */
+    {"NS_KICK_DONE", "Kicked $b%d$b users from %s"}, /* {ARGS: 20, "#TestChan"} */
+    {"NS_KICK_FAIL", "$b%s$b could not kick some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
+    {"NS_KICKBAN_DONE", "KickBanned $b%d$b users from %s"}, /* {ARGS: 10, "#TestChan"} */
+    {"NS_KICKBAN_FAIL", "$b%s$b could not kickban some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
+    {"NS_BAN_DONE", "$b%d$b masks added to the %s ban list. (matching %d users)"}, /* {ARGS: 5, "#TestChan", 15} */
+    {"NS_BAN_FAIL", "$b%s$b could not kickban some of the nicks you provided."}, /* {ARGS: "NeonServ"} */
+    {"NS_LAME_MASK", "$b%s$b is a little too general. Try making it more specific."}, /* {ARGS: "*!*@*"} */
     {"NS_SET_HEADER", "Channel Settings for %s:"}, /* {ARGS: "#TestChan"} */
     {"NS_SET_ON", "on"},
     {"NS_SET_OFF", "off"},
-    {"NS_SET_UNKNOWN_SETTING", "\002%s\002 is an unknown channel setting."}, /* {ARGS: "TestSetting"} */
+    {"NS_SET_UNKNOWN_SETTING", "$b%s$b is an unknown channel setting."}, /* {ARGS: "TestSetting"} */
     {"NS_SET_CANNOT_SET", "That setting is above your current level, so you cannot change it."},
     {"NS_SET_BADLEVEL", "You cannot change any setting to above your level."},
-    {"NS_SET_INVALID_OPTION", "\002%s\002 is not a valid choice.  Choose one:"}, /* {ARGS: 5} */
-    {"NS_SET_INVALID_BOOLEAN", "\002%s\002 is an invalid binary value."}, /* {ARGS: 2} */
+    {"NS_SET_INVALID_OPTION", "$b%s$b is not a valid choice.  Choose one:"}, /* {ARGS: 5} */
+    {"NS_SET_INVALID_BOOLEAN", "$b%s$b is an invalid binary value."}, /* {ARGS: 2} */
     {"NS_SET_DEFAULTS_OWNER", "You must have access 500 in %s to reset it to the default options."}, /* {ARGS: "#TestChan"} */
     {"NS_SET_DEFAULTS_CODE", "To reset %s's settings to the defaults, you must use 'set defaults %s'."}, /* {ARGS: "#TestChan", "abc123"} */
     {"NS_SET_DEFAULTS_DONE", "All settings for %s have been reset to default values."}, /* {ARGS: "#TestChan"} */
     {"NS_SET_TRIGGER_OWNER", "You must have access 500 in %s to change the channel trigger."}, /* {ARGS: "#TestChan"} */
-    {"NS_WIPEINFO_DONE", "Removed \002%s\002's infoline in \002%s\002."}, /* {ARGS: "TestUser", "#TestChan"} */
+    {"NS_WIPEINFO_DONE", "Removed $b%s$b's infoline in $b%s$b."}, /* {ARGS: "TestUser", "#TestChan"} */
     {"NS_TRACE_HEADER", "The following users were found:"},
-    {"NS_ADDBAN_DONE", "\002%s\002 permantly added to the %s ban list. (matching %d users)"}, /* {ARGS: "*!*@Test.*", "#TestChan", 4} */
+    {"NS_ADDBAN_DONE", "$b%s$b permantly added to the %s ban list. (matching %d users)"}, /* {ARGS: "*!*@Test.*", "#TestChan", 4} */
     {"NS_BANS_HEADER_MASK", "Mask"},
     {"NS_BANS_HEADER_SETBY", "Set By"},
     {"NS_BANS_HEADER_TRIGGERED", "Triggered"},
     {"NS_BANS_HEADER_EXPIRES", "Expires"},
     {"NS_BANS_HEADER_REASON", "Reason"},
     {"NS_DELBAN_BANNED_BY", "%s is banned by %s."}, /* {ARGS: "*!*@bla*", "*!*@b*"} */
-    {"NS_DELBAN_FAIL", "Sorry, no ban found for \002%s\002."}, /* {ARGS: "*!*@bla*"} */
-    {"NS_DELBAN_DONE", "Removed \002%s\002 from the %s ban list."}, /* {ARGS: "*!*@bla.*", "#TestChan"} */
-    {"NS_NETINFO_HEADER", "\002Network information\002"},
+    {"NS_DELBAN_FAIL", "Sorry, no ban found for $b%s$b."}, /* {ARGS: "*!*@bla*"} */
+    {"NS_DELBAN_DONE", "Removed $b%s$b from the %s ban list."}, /* {ARGS: "*!*@bla.*", "#TestChan"} */
+    {"NS_NETINFO_HEADER", "$bNetwork information$b"},
     {"NS_NETINFO_BOTS", "Bots:"},
     {"NS_NETINFO_UPTIME", "Uptime:"},
     {"NS_NETINFO_TRAFFIC", "Traffic:"},
@@ -151,42 +151,42 @@ static const struct default_language_entry msgtab[] = {
     {"NS_NETINFO_CODE_VALUE", "%s lines c code (view it at http://git.pk910.de/?p=NeonServV5.git;a=summary)"}, /* {ARGS: 20} */
     {"NS_NETINFO_COMPILER", "Compiler:"},
     {"NS_NETINFO_COMPILER_VALUE", "%s  (%s)"}, /* {ARGS: "GCC 4.4.5", "Sun Sep 18 2011 at 05:21:33 CEST"} */
-    {"NS_EXTTOPIC_INVALID_ID", "ADVANCEDTOPIC is enabled and \002%s\002 is an invalid TOPIC ID. Valid topic id's are: 1-9"}, /* {ARGS: 10} */
+    {"NS_EXTTOPIC_INVALID_ID", "ADVANCEDTOPIC is enabled and $b%s$b is an invalid TOPIC ID. Valid topic id's are: 1-9"}, /* {ARGS: 10} */
     {"NS_EXTTOPIC_TOPICID", "Topic %d: %s"}, /* {ARGS: 5, "topic"} */
     {"NS_TOPIC_DONE", "Topic is now '%s'."}, /* {ARGS: "i like you :D"} */
     {"NS_CHANSERVSYNC_UNSUPPORTED", "\0034WARNING\003: the user list style of %s is not known. %s can try to synchronize the userlist, but there is no guarantee that it is successful!"}, /* {ARGS: "CowBot"} */
     {"NS_CHANSERVSYNC_KEY", "If you really want to synchronize the %s userlist with %s use: chanservsync %s %s"}, /* {ARGS: "#TestChan", "CowBot", "CowBot", "abc123"} */
-    {"NS_CHANSERVSYNC_INUSE", "\002chanservsync\002 is already in use by someone else. Please try again in a few seconds..."},
-    {"NS_CHANSERVSYNC_SYNCHRONIZING", "Synchronizing userlist in %s with \002%s\002..."}, /* {ARGS: "#TestChan", "CowBot"} */
-    {"NS_CHANSERVSYNC_SYNCHRONIZED", "Synchronized user \002%s\002: access \002%d\002"}, /* {ARGS: "TestUser", 123} */
+    {"NS_CHANSERVSYNC_INUSE", "$bchanservsync$b is already in use by someone else. Please try again in a few seconds..."},
+    {"NS_CHANSERVSYNC_SYNCHRONIZING", "Synchronizing userlist in %s with $b%s$b..."}, /* {ARGS: "#TestChan", "CowBot"} */
+    {"NS_CHANSERVSYNC_SYNCHRONIZED", "Synchronized user $b%s$b: access $b%d$b"}, /* {ARGS: "TestUser", 123} */
     {"NS_REGISTER_ALREADY", "%s is already registered with %s."}, /* {ARGS: "#TestChan", "NeonServ"} */
     {"NS_INVALID_CHANNEL_NAME", "%s is not a valid channel name."}, /* {ARGS: "#invalid"} */
     {"NS_REGISTER_FULL", "the bot can not join more channels."},
     {"NS_REGISTER_DISCONNECTED", "%s has been registered with a Bot, that is currently NOT connected. The Bot should join the channel, when it reconnects to the IRC-Network."}, /* {ARGS: "#TestChan"} */
-    {"NS_REGISTER_DONE", "\002%s\002 is now registered to \002%s\002."}, /* {ARGS: "#TestChan", "TestUser"} */
-    {"NS_UNREGISTER_NOT_REGISTERED", "\002%s\002 is not registered with %s."}, /* {ARGS: "#TestChan", "NeonServ"} */
-    {"NS_UNREGISTER_DONE", "\002%s\002 unregistered."}, /* {ARGS: "#TestChan"} */
-    {"NS_RECOVER_DONE", "\002%s\002 has been recovered."}, /* {ARGS: "#TestChan"} */
-    {"NS_RESYNC_DONE", "Synchronized users in \002%s\002 with the userlist."}, /* {ARGS: "#TestChan"} */
+    {"NS_REGISTER_DONE", "$b%s$b is now registered to $b%s$b."}, /* {ARGS: "#TestChan", "TestUser"} */
+    {"NS_UNREGISTER_NOT_REGISTERED", "$b%s$b is not registered with %s."}, /* {ARGS: "#TestChan", "NeonServ"} */
+    {"NS_UNREGISTER_DONE", "$b%s$b unregistered."}, /* {ARGS: "#TestChan"} */
+    {"NS_RECOVER_DONE", "$b%s$b has been recovered."}, /* {ARGS: "#TestChan"} */
+    {"NS_RESYNC_DONE", "Synchronized users in $b%s$b with the userlist."}, /* {ARGS: "#TestChan"} */
     {"NS_TIMEBAN_DURATION_TOO_SHORT", "You must specify a ban duration of at least %d seconds."}, /* {ARGS: 30} */
-    {"NS_TIMEBAN_DONE", "Banned \002%s\002 from %s for %s. (matching %d users)"}, /* {ARGS: "*!*@bla*", "#TestChan", "2 hours", 5} */
-    {"NS_MODE_INVALID", "\002%c\002 is an invalid set of channel modes."}, /* {ARGS: "+xyz"} */
-    {"NS_MODE_LOCKED", "Modes conflicting with \002%s\002 are not allowed in %s."}, /* {ARGS: "+xyz", "#TestChan"} */
-    {"NS_MODE_DONE", "Channel modes are now \002%s\002."}, /* {ARGS: "+xyz"} */
-    {"NS_MODE_ENFOPS", "You may not op or deop users on \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_MODE_ENFVOICE", "You may not voice or devoice users on \002%s\002."}, /* {ARGS: "#TestChan"} */
-    {"NS_MODE_CANBAN", "You may not ban or unban users on \002%s\002."}, /* {ARGS: "#TestChan"} */
+    {"NS_TIMEBAN_DONE", "Banned $b%s$b from %s for %s. (matching %d users)"}, /* {ARGS: "*!*@bla*", "#TestChan", "2 hours", 5} */
+    {"NS_MODE_INVALID", "$b%c$b is an invalid set of channel modes."}, /* {ARGS: "+xyz"} */
+    {"NS_MODE_LOCKED", "Modes conflicting with $b%s$b are not allowed in %s."}, /* {ARGS: "+xyz", "#TestChan"} */
+    {"NS_MODE_DONE", "Channel modes are now $b%s$b."}, /* {ARGS: "+xyz"} */
+    {"NS_MODE_ENFOPS", "You may not op or deop users on $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_MODE_ENFVOICE", "You may not voice or devoice users on $b%s$b."}, /* {ARGS: "#TestChan"} */
+    {"NS_MODE_CANBAN", "You may not ban or unban users on $b%s$b."}, /* {ARGS: "#TestChan"} */
     {"NS_GOD_ON", "Security override has been enabled."},
     {"NS_GOD_OFF", "Security override has been disabled."},
-    {"NS_PEEK_HEADER", "\002%s\002 Status:"}, /* {ARGS: "#TestChan"} */
+    {"NS_PEEK_HEADER", "$b%s$b Status:"}, /* {ARGS: "#TestChan"} */
     {"NS_PEEK_TOPIC", "Topic:       %s"}, /* {ARGS: "TOPIC"} */
     {"NS_PEEK_MODES", "Modes:       %s"}, /* {ARGS: "+xyz"} */
     {"NS_PEEK_USERS", "Total Users: %d (%d ops, %d voices, %d regulars, %d invisible)"}, /* {ARGS: 20, 4, 6, 8, 2} */
     {"NS_PEEK_OPS", "Ops:"},
-    {"NS_USET_GLOBAL", "\002--- Global ---\002"},
-    {"NS_USET_CHANNEL", "\002--- User options (channel) ---\002"},
+    {"NS_USET_GLOBAL", "$b--- Global ---$b"},
+    {"NS_USET_CHANNEL", "$b--- User options (channel) ---$b"},
     {"NS_USET_NO_ACCESS", "no access"},
-    {"NS_USET_UNKNOWN_SETTING", "\002%s\002 is an unknown uset setting."}, /* {ARGS: "TestSetting"} */
+    {"NS_USET_UNKNOWN_SETTING", "$b%s$b is an unknown uset setting."}, /* {ARGS: "TestSetting"} */
     {NULL, NULL}
 };
 
diff --git a/lang.c b/lang.c
index 3aaca2f90be0719c1ad520f371826288d9b6e7df..e50e752741e1a2a54e6812c6c96b2d09b16c2d05 100644 (file)
--- a/lang.c
+++ b/lang.c
@@ -86,7 +86,7 @@ struct language* get_language_by_tag(char *tag) {
     int cindex;
     for(cindex = 0; cindex < MAXLANGUAGES; cindex++) {
         if(langdict[cindex] == NULL) break;
-        if(!strcmp(langdict[cindex]->langtag, tag))
+        if(!stricmp(langdict[cindex]->langtag, tag))
             return langdict[cindex];
     }
     return NULL;
@@ -96,7 +96,7 @@ struct language* get_language_by_name(char *name) {
     int cindex;
     for(cindex = 0; cindex < MAXLANGUAGES; cindex++) {
         if(langdict[cindex] == NULL) break;
-        if(!strcmp(langdict[cindex]->langname, name))
+        if(!stricmp(langdict[cindex]->langname, name))
             return langdict[cindex];
     }
     return NULL;
@@ -111,19 +111,8 @@ struct language* get_default_language() {
 void register_default_language_table(const struct default_language_entry *msgtab) {
     if(lang_c == NULL) 
         lang_c = add_language(DEFAULT_LANG_TAG, DEFAULT_LANG_NAME);
-    struct language_table *lang_entry;
-    int cindex;
     while(msgtab->ident) {
-        cindex = get_entry_index(msgtab->ident);
-        lang_entry = malloc(sizeof(*lang_entry));
-        if (!lang_entry) {
-            perror("malloc() failed");
-            return;
-        }
-        lang_entry->ident = strdup(msgtab->ident);
-        lang_entry->text = strdup(msgtab->text);
-        lang_entry->next = lang_c->entrys[cindex];
-        lang_c->entrys[cindex] = lang_entry;
+        register_language_string(lang_c, msgtab->ident, msgtab->text);
         msgtab++;
     }
 }
@@ -135,8 +124,36 @@ void register_language_string(struct language *lang, char *ident, char *text) {
         perror("malloc() failed");
         return;
     }
+    
     lang_entry->ident = strdup(ident);
-    lang_entry->text = strdup(text);
+    //replace all:
+    //$b to \002
+    //$k to \003
+    char txt[MAXLEN];
+    strcpy(txt, text);
+    char tmp[MAXLEN];
+    int tmppos = 0;
+    char *a, *b = txt;
+    do {
+        a = strstr(b, "$");
+        if(a) *a = '\0';
+        tmppos += sprintf(tmp + tmppos, "%s", b);
+        if(a) {
+            switch(a[1]) {
+                case 'b':
+                    tmp[tmppos++] = '\002';
+                    break;
+                case 'k':
+                    tmp[tmppos++] = '\003';
+                    break;
+                default:
+                    //unknown - just write it
+                    tmppos += sprintf(tmp + tmppos, "$%c", a[1]);
+            }
+            b = a+2;
+        }
+    } while(a);
+    lang_entry->text = strdup(tmp);
     lang_entry->next = lang->entrys[cindex];
     lang->entrys[cindex] = lang_entry;
 }
index 507b907128f0010b83b8a5ee02c0671d27897b2e..95d47b06e4a36b6548095b6be400767c6083941b 100644 (file)
--- a/modcmd.c
+++ b/modcmd.c
@@ -38,8 +38,8 @@ static const struct default_language_entry msgtab[] = {
     {"MODCMD_LESS_PARAM_COUNT", "This command requires more parameters."},
     {"MODCMD_CHAN_REQUIRED",    "You must provide the name of a channel that exists."},
     {"MODCMD_AUTH_REQUIRED",    "You need to be authenticated with AuthServ to use this command."},
-    {"MODCMD_PRIVILEGED",       "\002%s\002 is a privileged command."}, /* {ARGS: "god"} */
-    {"MODCMD_PUBCMD",           "Public commands in \002%s\002 are restricted."}, /* {ARGS: "#TestChan"} */
+    {"MODCMD_PRIVILEGED",       "$b%s$b is a privileged command."}, /* {ARGS: "god"} */
+    {"MODCMD_PUBCMD",           "Public commands in $b%s$b are restricted."}, /* {ARGS: "#TestChan"} */
     {"MODCMD_ACCESS_DENIED",    "Access denied."},
     {NULL, NULL}
 };