fix: Rename "Chat" tooltip to "Messages"

... and do it the proper way, ie. make the string translatable as we
can't handle translations coming from NIM files at the moment

Closes #8418
This commit is contained in:
Lukáš Tinkl 2022-12-12 13:39:25 +01:00 committed by Lukáš Tinkl
parent ed5893a8d0
commit 73cc621f0c
5 changed files with 24 additions and 4 deletions

View File

@ -1,4 +1,4 @@
const CHAT_SECTION_NAME* = "Chat"
const CHAT_SECTION_NAME* = "Messages"
const CHAT_SECTION_ICON* = "chat"
const COMMUNITIESPORTAL_SECTION_ID* = "communitiesPortal"

View File

@ -228,7 +228,7 @@ proc createChannelGroupItem[T](self: Module[T], c: ChannelGroupDto): SectionItem
result = initItem(
c.id,
if isCommunity: SectionType.Community else: SectionType.Chat,
if isCommunity: c.name else: "Chat",
if isCommunity: c.name else: conf.CHAT_SECTION_NAME,
c.admin,
c.description,
c.introMessage,

View File

@ -34,7 +34,7 @@ delete_Channel_ConfirmationDialog_DeleteButton = {"container": statusDesktop_mai
# Main Window - chat related:
mainWindow_statusChatNavBarListView_ListView = {"container": statusDesktop_mainWindow, "objectName": "statusChatNavBarListView", "type": "ListView", "visible": True}
navBarListView_Chat_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_statusChatNavBarListView_ListView, "objectName": "Chat-navbar", "type": "StatusNavBarTabButton", "visible": True}
navBarListView_Chat_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_statusChatNavBarListView_ListView, "objectName": "Messages-navbar", "type": "StatusNavBarTabButton", "visible": True}
mainWindow_public_chat_icon_StatusIcon = {"container": statusDesktop_mainWindow, "objectName": "public-chat-icon", "source": "qrc:/StatusQ/src/assets/img/icons/public-chat.svg", "type": "StatusIcon", "visible": True}
chatList_Repeater = {"container": statusDesktop_mainWindow, "objectName": "chatListItems", "type": "Repeater"}
chatList = {"container": statusDesktop_mainWindow, "objectName": "ContactsColumnView_chatList", "type": "StatusChatList"}

View File

@ -488,7 +488,7 @@ Item {
name: model.icon.length > 0? "" : model.name
icon.name: model.icon
icon.source: model.image
tooltip.text: model.name
tooltip.text: Utils.translatedSectionName(model.sectionType, model.name)
checked: model.active
badge.value: model.notificationsCount
badge.visible: model.hasNotification

View File

@ -776,6 +776,26 @@ QtObject {
return link.replace(Constants.socialLinkPrefixesByType[type], "")
}
// handle translations for section names coming from app_sections_config.nim
function translatedSectionName(sectionType, fallback) {
switch(sectionType) {
case Constants.appSection.chat:
return qsTr("Messages")
case Constants.appSection.wallet:
return qsTr("Wallet")
case Constants.appSection.browser:
return qsTr("Browser")
case Constants.appSection.profile:
return qsTr("Settings")
case Constants.appSection.node:
return qsTr("Node Management")
case Constants.appSection.communitiesPortal:
return qsTr("Communities Portal")
default:
return fallback
}
}
// Leave this function at the bottom of the file as QT Creator messes up the code color after this
function isPunct(c) {
return /(!|\@|#|\$|%|\^|&|\*|\(|\)|\+|\||-|=|\\|{|}|[|]|"|;|'|<|>|\?|,|\.|\/)/.test(c)