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:
parent
ed5893a8d0
commit
73cc621f0c
|
@ -1,4 +1,4 @@
|
||||||
const CHAT_SECTION_NAME* = "Chat"
|
const CHAT_SECTION_NAME* = "Messages"
|
||||||
const CHAT_SECTION_ICON* = "chat"
|
const CHAT_SECTION_ICON* = "chat"
|
||||||
|
|
||||||
const COMMUNITIESPORTAL_SECTION_ID* = "communitiesPortal"
|
const COMMUNITIESPORTAL_SECTION_ID* = "communitiesPortal"
|
||||||
|
|
|
@ -228,7 +228,7 @@ proc createChannelGroupItem[T](self: Module[T], c: ChannelGroupDto): SectionItem
|
||||||
result = initItem(
|
result = initItem(
|
||||||
c.id,
|
c.id,
|
||||||
if isCommunity: SectionType.Community else: SectionType.Chat,
|
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.admin,
|
||||||
c.description,
|
c.description,
|
||||||
c.introMessage,
|
c.introMessage,
|
||||||
|
|
|
@ -34,7 +34,7 @@ delete_Channel_ConfirmationDialog_DeleteButton = {"container": statusDesktop_mai
|
||||||
|
|
||||||
# Main Window - chat related:
|
# Main Window - chat related:
|
||||||
mainWindow_statusChatNavBarListView_ListView = {"container": statusDesktop_mainWindow, "objectName": "statusChatNavBarListView", "type": "ListView", "visible": True}
|
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}
|
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_Repeater = {"container": statusDesktop_mainWindow, "objectName": "chatListItems", "type": "Repeater"}
|
||||||
chatList = {"container": statusDesktop_mainWindow, "objectName": "ContactsColumnView_chatList", "type": "StatusChatList"}
|
chatList = {"container": statusDesktop_mainWindow, "objectName": "ContactsColumnView_chatList", "type": "StatusChatList"}
|
||||||
|
|
|
@ -488,7 +488,7 @@ Item {
|
||||||
name: model.icon.length > 0? "" : model.name
|
name: model.icon.length > 0? "" : model.name
|
||||||
icon.name: model.icon
|
icon.name: model.icon
|
||||||
icon.source: model.image
|
icon.source: model.image
|
||||||
tooltip.text: model.name
|
tooltip.text: Utils.translatedSectionName(model.sectionType, model.name)
|
||||||
checked: model.active
|
checked: model.active
|
||||||
badge.value: model.notificationsCount
|
badge.value: model.notificationsCount
|
||||||
badge.visible: model.hasNotification
|
badge.visible: model.hasNotification
|
||||||
|
|
|
@ -776,6 +776,26 @@ QtObject {
|
||||||
return link.replace(Constants.socialLinkPrefixesByType[type], "")
|
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
|
// Leave this function at the bottom of the file as QT Creator messes up the code color after this
|
||||||
function isPunct(c) {
|
function isPunct(c) {
|
||||||
return /(!|\@|#|\$|%|\^|&|\*|\(|\)|\+|\||-|=|\\|{|}|[|]|"|;|'|<|>|\?|,|\.|\/)/.test(c)
|
return /(!|\@|#|\$|%|\^|&|\*|\(|\)|\+|\||-|=|\\|{|}|[|]|"|;|'|<|>|\?|,|\.|\/)/.test(c)
|
||||||
|
|
Loading…
Reference in New Issue