From: Rick L Bird Date: Sat, 14 May 2011 17:17:37 +0000 (-0400) Subject: Added some translation wrappers X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=e6db4a1fab14844de94da8ec9a9b65635ab33d1a;p=cobramush.git Added some translation wrappers --- diff --git a/src/command.c b/src/command.c index 0f76307..0c071b4 100644 --- a/src/command.c +++ b/src/command.c @@ -1684,12 +1684,12 @@ COMMAND(cmd_command) if (SW_ISSET(sw, SWITCH_ALIAS)) { if (Director(player)) { if (!ok_command_name(upcasestr(arg_right))) { - notify(player, "I can't alias a command to that!"); + notify(player, T("I can't alias a command to that!")); } else if (!alias_command(arg_left, arg_right)) { - notify(player, "Unable to set alias."); + notify(player, T("Unable to set alias.")); } else { if (!SW_ISSET(sw, SWITCH_QUIET)) - notify(player, "Alias set."); + notify(player, T("Alias set.")); } } else { notify(player, T("Permission denied.")); @@ -1721,13 +1721,13 @@ COMMAND(cmd_command) if(command->lock != TRUE_BOOLEXP) free_boolexp(command->lock); command->lock = key; - notify(player, "Command locked."); + notify(player, T("Command locked.")); } else notify(player, T("I don't understand that key.")); } else { if(command->lock != TRUE_BOOLEXP) free_boolexp(command->lock); command->lock = TRUE_BOOLEXP; - notify(player, "Command unlocked."); + notify(player, T("Command unlocked.")); } return; } @@ -1749,7 +1749,7 @@ COMMAND(cmd_command) } if (!SW_ISSET(sw, SWITCH_QUIET)) { notify_format(player, - "Name : %s (%s)", command->name, + T("Name : %s (%s)"), command->name, (command->type & CMD_T_DISABLED) ? "Disabled" : "Enabled"); if ((command->type & CMD_T_ANY) == CMD_T_ANY) safe_strl("Any", 3, buff, &bp); @@ -1767,7 +1767,7 @@ COMMAND(cmd_command) strccat(buff, &bp, "Division"); } *bp = '\0'; - notify_format(player, "Types : %s", buff); + notify_format(player, T("Types : %s"), buff); buff[0] = '\0'; bp = buff; if (command->type & CMD_T_SWITCHES) @@ -1789,18 +1789,18 @@ COMMAND(cmd_command) else if (command->type & CMD_T_LOGNAME) strccat(buff, &bp, "LogName"); *bp = '\0'; - notify_format(player, "Restrict : %s", buff); + notify_format(player, T("Restrict : %s"), buff); buff[0] = '\0'; - notify_format(player, "Command Lock : %s", unparse_boolexp(player, command->lock, UB_MEREF)); + notify_format(player, T("Command Lock : %s"), unparse_boolexp(player, command->lock, UB_MEREF)); if (command->sw.mask) { bp = buff; for (sw_val = dyn_switch_list; sw_val->name; sw_val++) if (SW_ISSET(command->sw.mask, sw_val->value)) strccat(buff, &bp, sw_val->name); *bp = '\0'; - notify_format(player, "Switches : %s", buff); + notify_format(player, T("Switches : %s"), buff); } else - notify(player, "Switches :"); + notify(player, T("Switches :")); buff[0] = '\0'; bp = buff; if (command->type & CMD_T_LS_ARGS) { @@ -1813,7 +1813,7 @@ COMMAND(cmd_command) strccat(buff, &bp, "Noparse"); if (command->type & CMD_T_EQSPLIT) { *bp = '\0'; - notify_format(player, "Leftside : %s", buff); + notify_format(player, T("Leftside : %s"), buff); buff[0] = '\0'; bp = buff; if (command->type & CMD_T_RS_ARGS) { @@ -1825,10 +1825,10 @@ COMMAND(cmd_command) if (command->type & CMD_T_RS_NOPARSE) strccat(buff, &bp, "Noparse"); *bp = '\0'; - notify_format(player, "Rightside : %s", buff); + notify_format(player, T("Rightside : %s"), buff); } else { *bp = '\0'; - notify_format(player, "Arguments : %s", buff); + notify_format(player, T("Arguments : %s"), buff); } do_hook_list(player, arg_left); } diff --git a/src/comp_w.c b/src/comp_w.c index 7692cf0..0a506be 100644 --- a/src/comp_w.c +++ b/src/comp_w.c @@ -315,8 +315,8 @@ text_uncompress(unsigned char const *s) exit(1); } else { panicking = 1; /* don't panic from within panic */ - do_rawlog(LT_ERR, "Error in string decompression, i = %i", i); - mush_panic("Fatal error in decompression"); + do_rawlog(LT_ERR, T("Error in string decompression, i = %i"), i); + mush_panic(T("Fatal error in decompression")); } } strncpy((char *) b, words[i], words_len[i]); diff --git a/src/comp_w8.c b/src/comp_w8.c index fb85c22..7e9e16f 100644 --- a/src/comp_w8.c +++ b/src/comp_w8.c @@ -212,7 +212,7 @@ output_previous_word(void) words[i] = malloc(wordpos); if (!words[i]) - mush_panic("Out of memory in string compression routine"); + mush_panic(T("Out of memory in string compression routine")); #ifdef COMP_STATS total_mallocs += wordpos; @@ -321,7 +321,7 @@ text_uncompress(unsigned char const *s) } else { panicking = 1; /* don't panic from within panic */ fprintf(stderr, "Error in string decompression, i = %i\n", i); - mush_panic("Fatal error in decompression"); + mush_panic(T("Fatal error in decompression")); } } strncpy((char *) b, words[i], words_len[i]); diff --git a/src/conf.c b/src/conf.c index 41ddbce..7ae183c 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1724,7 +1724,7 @@ do_enable(dbref player, const char *param, int state) else notify(player, T("Enabled.")); do_log(LT_WIZ, player, NOTHING, "%s %s", - cp->name, (state) ? "ENABLED" : "DISABLED"); + cp->name, (state) ? T("ENABLED") : T("DISABLED")); } else notify(player, T("That isn't a on/off option.")); return; diff --git a/src/cque.c b/src/cque.c index 1cb4665..0a86eb3 100644 --- a/src/cque.c +++ b/src/cque.c @@ -1909,17 +1909,17 @@ do_restart_com(dbref player, const char *arg1) Name(player)); } else { notify_format(player, - "Restarting: %s's %s(%s)", + T("Restarting: %s's %s(%s)"), Name(Owner(victim)), Name(victim), unparse_dbref(victim)); - notify_format(Owner(victim), "Restarting: %s(%s), by %s", + notify_format(Owner(victim), T("Restarting: %s(%s), by %s"), Name(victim), unparse_dbref(victim), Name(player)); } } else { if (victim == player) notify(player, T("All of your objects are being restarted.")); else - notify_format(player, "Restarting: %s(%s)", Name(victim), + notify_format(player, T("Restarting: %s(%s)"), Name(victim), unparse_dbref(victim)); } do_halt(player, "", victim); diff --git a/src/create.c b/src/create.c index 98b1d9a..4a1a810 100644 --- a/src/create.c +++ b/src/create.c @@ -108,7 +108,7 @@ do_real_open(dbref player, const char *direction, const char *linkto, Location(player))); dbref new_exit; if (!command_check_byname(player, "@dig")) { - notify(player, "Permission denied."); + notify(player, T("Permission denied.")); return NOTHING; } if ((loc == NOTHING) || (!IsRoom(loc))) { @@ -382,7 +382,7 @@ do_link(dbref player, const char *name, const char *room_name, int preserve) } break; default: - notify(player, "Internal error: weird object type."); + notify(player, T("Internal error: weird object type.")); do_log(LT_ERR, NOTHING, NOTHING, T("Weird object! Type of #%d is %d"), thing, Typeof(thing)); break; diff --git a/src/extmail.c b/src/extmail.c index 838c4d0..3b33176 100644 --- a/src/extmail.c +++ b/src/extmail.c @@ -2774,7 +2774,7 @@ filter_mail(dbref from, dbref player, char *subject, arg3 = mush_malloc(BUFFER_LEN, "string"); arg4 = mush_malloc(BUFFER_LEN, "string"); if (!arg4) - mush_panic("Unable to allocate memory in mailfilter"); + mush_panic(T("Unable to allocate memory in mailfilter")); save_global_regs("filter_mail", rsave); save_global_env("filter_mail", wsave); for (j = 0; j < 10; j++) diff --git a/src/flags.c b/src/flags.c index 2109d09..c2f2867 100644 --- a/src/flags.c +++ b/src/flags.c @@ -302,7 +302,7 @@ new_flag(void) flag_slab = slab_create("flags", sizeof(FLAG)); f = slab_malloc(flag_slab, NULL); if (!f) - mush_panic("Unable to allocate memory for a new flag!\n"); + mush_panic(T("Unable to allocate memory for a new flag!\n")); return f; } @@ -385,7 +385,7 @@ flag_add(FLAGSPACE *n, const char *name, FLAG *f) mush_realloc(n->flags, (f->bitpos + 1) * sizeof(FLAG *), "flagspace.flags"); if (!n->flags) - mush_panic("Unable to reallocate flags array!\n"); + mush_panic(T("Unable to reallocate flags array!\n")); /* Make sure the new space is full of NULLs */ for (i = n->flagbits; i <= f->bitpos; i++) @@ -965,7 +965,7 @@ new_flag_bitmask(const char *ns) Flagspace_Lookup(n, ns); bitmask = mush_malloc(FlagBytes(n), "flag_bitmask"); if (!bitmask) - mush_panic("Unable to allocate memory for flag bitmask"); + mush_panic(T("Unable to allocate memory for flag bitmask")); memset(bitmask, 0, FlagBytes(n)); return bitmask; } @@ -986,7 +986,7 @@ clone_flag_bitmask(const char *ns, object_flag_type given) Flagspace_Lookup(n, ns); bitmask = (object_flag_type) mush_malloc(FlagBytes(n), "flag_bitmask"); if (!bitmask) - mush_panic("Unable to allocate memory for flag bitmask"); + mush_panic(T("Unable to allocate memory for flag bitmask")); memcpy(bitmask, given, FlagBytes(n)); return bitmask; }