From 92e9ac8753f83f6bd8e080b63d6707e633113b43 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Fri, 23 Oct 2020 13:13:40 +0200 Subject: [PATCH] Add translator notes, fix wrong message --- secret-chat.cpp | 6 ++++-- td-client.cpp | 4 +++- tdlib-purple.cpp | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/secret-chat.cpp b/secret-chat.cpp index a2f786a..cc797ba 100644 --- a/secret-chat.cpp +++ b/secret-chat.cpp @@ -16,6 +16,7 @@ void updateKnownSecretChat(SecretChatId secretChatId, TdTransceiver &transceiver int state = (secretChat && secretChat->state_) ? secretChat->state_->get_id() : td::td_api::secretChatStateClosed::ID; std::string purpleBuddyName = getSecretChatBuddyName(secretChatId); + // TRANSLATOR: Default buddy-alias for a new secret chat. Argument is the Telegram nick, I think. std::string alias = formatMessage(_("Secret chat: {}"), chat->title_); PurpleBuddy *buddy = purple_find_buddy(account.purpleAccount, purpleBuddyName.c_str()); @@ -45,10 +46,11 @@ void updateKnownSecretChat(SecretChatId secretChatId, TdTransceiver &transceiver // This should be a newly created secret chat, so if we requested it, open the conversation if (secretChat && secretChat->is_outbound_) { - if (state == td::td_api::secretChatStatePending::ID) + if (state == td::td_api::secretChatStatePending::ID) { + // TRANSLATOR: In-chat message to explain why the chat is not established yet. showChatNotification(account, *chat, _("The secret chat will be available when activated by the peer"), PURPLE_MESSAGE_NO_LOG); - else + } else // Shouldn't really be possible, but just in case getImConversation(account.purpleAccount, purpleBuddyName.c_str()); } diff --git a/td-client.cpp b/td-client.cpp index 95b093d..5823220 100644 --- a/td-client.cpp +++ b/td-client.cpp @@ -2265,10 +2265,12 @@ void PurpleTdClient::createSecretChat(const char* buddyName) // Unlikely error messages not worth translating const char *reason = users.empty() ? "User not found" : "More than one user found with this name"; - std::string message = formatMessage(_("Cannot kick user: {}"), std::string(reason)); + std::string message = formatMessage("Cannot create secret chat: {}", std::string(reason)); purple_notify_error(purple_account_get_connection(m_account), + // TRANSLATOR: Failure notification, title _("Failed to create secret chat"), message.c_str(), NULL); + return; } diff --git a/tdlib-purple.cpp b/tdlib-purple.cpp index 95d4054..a04c65b 100644 --- a/tdlib-purple.cpp +++ b/tdlib-purple.cpp @@ -243,6 +243,7 @@ static GList* tgprpl_blist_node_menu (PurpleBlistNode *node) { fprintf(stderr, "Creating secret chat menu for %s\n", purple_buddy_get_name(PURPLE_BUDDY(node))); PurpleMenuAction *action; + // TRANSLATOR: Buddy menu action item action = purple_menu_action_new(_("Start secret chat"), PURPLE_CALLBACK(createSecretChat), NULL, NULL);