ux: standardize private message terminology

This commit is contained in:
m1ngsama 2026-05-24 12:30:08 +08:00
parent 01439507d5
commit 00fc944da8
9 changed files with 24 additions and 12 deletions

View file

@ -90,9 +90,9 @@ Ctrl+C - Exit chat
```
:list, :users - Show online users
:nick <name> - Change nickname
:msg <user> <text> - Whisper to user
:msg <user> <message> - Send private message
:w <user> <text> - Short alias for :msg
:inbox - Show whispers
:inbox - Show private messages
:last [N] - Show last N messages from history (max 50, default 10)
:search <keyword> - Search full message history (case-insensitive)
:mute-joins - Toggle join/leave system notifications

View file

@ -8,6 +8,8 @@
catalog with coverage checks for every message ID.
- Kept command placeholders stable across localized output: Chinese help and
usage text now uses ASCII metavariables such as `<user>` and `<message>`.
- Standardized user-facing `:msg` / `:inbox` terminology around "private
message" / "私信" instead of mixing it with "whisper" wording.
- Renamed the internal language state from help-oriented names to
UI-language names (`ui_lang_t`, `client->ui_lang`, and
`i18n_*_ui_lang`) so future i18n work has a correctly named seam.

View file

@ -25,9 +25,9 @@ DEBUG
COMMANDS (COMMAND mode, prefix with :)
list, users, who show online users
nick <name> change nickname
msg <user> <text> whisper to user
msg <user> <message> send private message
w <user> <text> alias for msg
inbox show whispers
inbox show private messages
last [N] last N messages from log (default 10, max 50)
search <keyword> search full history (case-insensitive, 15 results)
mute-joins toggle join/leave notifications

View file

@ -30,7 +30,7 @@ static const command_catalog_entry_t entries[] = {
{
{TNT_COMMAND_INBOX, "inbox", {"inbox", NULL}, false},
":inbox", ":inbox",
"Show whispers", "查看私聊",
"Show private messages", "查看私信",
":inbox", ":inbox", 2
},
{

View file

@ -113,16 +113,16 @@ static const i18n_text_entry_t text_catalog[I18N_TEXT_COUNT] = {
" w <user> <message>\n"
},
[I18N_MSG_SENT_FORMAT] = {
"Whisper sent to %s\n",
"悄悄话已发送给 %s\n"
"Private message sent to %s\n",
"私信已发送给 %s\n"
},
[I18N_MSG_USER_NOT_FOUND_FORMAT] = {
"User '%s' not found\n",
"未找到用户 '%s'\n"
},
[I18N_INBOX_TITLE] = {
"Whispers",
"悄悄话"
"Private messages",
"私信"
},
[I18N_INBOX_EMPTY] = {
"(empty)",

View file

@ -294,7 +294,7 @@ expect "NORMAL"
send -- ":"
expect ":"
send -- "inbox\r"
expect "Whispers"
expect "Private messages"
expect "(empty)"
expect "q:close"
send -- "q"

View file

@ -67,10 +67,12 @@ TEST(generates_localized_help_sections) {
assert(strstr(en, ":users, :list, :who") != NULL);
assert(strstr(en, "Show online users") != NULL);
assert(strstr(en, ":msg <user> <message>") != NULL);
assert(strstr(en, "Show private messages") != NULL);
assert(strstr(en, ":support") == NULL);
assert(strstr(zh, ":users, :list, :who") != NULL);
assert(strstr(zh, "显示在线用户") != NULL);
assert(strstr(zh, "查看私信") != NULL);
assert(strstr(zh, ":msg <user> <message>") != NULL);
assert(strstr(zh, "<用户>") == NULL);
assert(strstr(zh, "<消息>") == NULL);

View file

@ -116,6 +116,14 @@ TEST(text_lookup_matches_language) {
"msg <user>") != NULL);
assert(strstr(i18n_text(UI_LANG_ZH, I18N_MSG_USAGE),
"<用户>") == NULL);
assert(strstr(i18n_text(UI_LANG_EN, I18N_MSG_SENT_FORMAT),
"Private message sent") != NULL);
assert(strstr(i18n_text(UI_LANG_ZH, I18N_MSG_SENT_FORMAT),
"私信已发送") != NULL);
assert(strstr(i18n_text(UI_LANG_EN, I18N_INBOX_TITLE),
"Private messages") != NULL);
assert(strstr(i18n_text(UI_LANG_ZH, I18N_INBOX_TITLE),
"私信") != NULL);
assert(strstr(i18n_text(UI_LANG_ZH, I18N_NICK_USAGE),
"nick <name>") != NULL);
assert(strstr(i18n_text(UI_LANG_EN, I18N_SEARCH_HEADER_FORMAT),

4
tnt.1
View file

@ -115,9 +115,9 @@ l l.
:list Show online users
:nick \fIname\fR Change nickname
:name \fIname\fR Alias for :nick
:msg \fIuser text\fR Send private whisper
:msg \fIuser message\fR Send private message
:w \fIuser text\fR Short alias for :msg
:inbox Show private whispers
:inbox Show private messages
:last [\fIN\fR] Show last N messages from history (1\-50, default 10)
:search \fIkeyword\fR Case\-insensitive search across full message history
:mute\-joins Toggle join/leave system notifications on/off