sw/inc/strings.hrc | 2 ++ sw/source/uibase/sidebar/CommentsPanel.cxx | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-)
New commits: commit a5cd4276244b9a635dab750e0decdf0c89d2d176 Author: Mohit Marathe <mohitmara...@proton.me> AuthorDate: Tue Oct 1 19:09:06 2024 +0530 Commit: Sarper Akdemir <sarper.akde...@allotropia.de> CommitDate: Wed Oct 2 15:09:03 2024 +0200 sw: replace hardcoded strings with SwResId to improve localization Change-Id: Ife431999fb53a44a2fab15468a995d91b5b65fea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174354 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akde...@allotropia.de> diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 5ff85970a3da..1bc9271c860e 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -427,6 +427,8 @@ #define STR_EDITINDEX NC_("STR_EDITINDEX", "Edit %1") #define STR_UPDATEINDEX NC_("STR_UPDATEINDEX", "Update %1") #define STR_DELETEINDEX NC_("STR_DELETEINDEX", "Delete %1") +#define STR_COMMENT_VIEW_MODE NC_("STR_COMMENT_VIEW_MODE", "View Mode") +#define STR_COMMENT_EDIT_MODE NC_("STR_COMMENT_EDIT_MODE", "Edit Mode") // Undo #define STR_CANT_UNDO NC_("STR_CANT_UNDO", "not possible") diff --git a/sw/source/uibase/sidebar/CommentsPanel.cxx b/sw/source/uibase/sidebar/CommentsPanel.cxx index eb4a40747fd1..0bfd33685093 100644 --- a/sw/source/uibase/sidebar/CommentsPanel.cxx +++ b/sw/source/uibase/sidebar/CommentsPanel.cxx @@ -75,7 +75,7 @@ Comment::Comment(weld::Container* pParent, CommentsPanel& rCommentsPanel) , mbResolved(false) { mxTextView->set_editable(false); - mxTextView->set_tooltip_text("View Mode"); + mxTextView->set_tooltip_text(SwResId(STR_COMMENT_VIEW_MODE)); mxTextView->connect_focus_out(LINK(this, Comment, OnFocusOut)); mxResolve->connect_toggled(LINK(this, Comment, ResolveClicked)); mxReply->connect_clicked(LINK(this, Comment, ReplyClicked)); @@ -96,7 +96,7 @@ IMPL_LINK(Comment, ContextMenuHdl, const MouseEvent&, rMEvt, bool) if (sId == "edit") { this->makeEditable(); - getTextView()->set_tooltip_text("Edit Mode"); + getTextView()->set_tooltip_text(SwResId(STR_COMMENT_EDIT_MODE)); } else if (sId == "reply") mrCommentsPanel.ReplyComment(this); @@ -158,7 +158,7 @@ void Comment::InitControls(const SwPostItField* pPostItField) IMPL_LINK_NOARG(Comment, OnFocusOut, weld::Widget&, void) { mrCommentsPanel.EditComment(this); - getTextView()->set_tooltip_text("View Mode"); + getTextView()->set_tooltip_text(SwResId(STR_COMMENT_VIEW_MODE)); } IMPL_LINK_NOARG(Comment, ResolveClicked, weld::Toggleable&, void) @@ -500,7 +500,7 @@ void CommentsPanel::addComment(const SwFormatField* pField) pThread->getCommentBoxWidget()->reorder_child(pComment->get_widget(), pThread->mnComments++); pComment->InitControls(pNote->GetPostItField()); - pComment->getTextView()->set_tooltip_text("Edit Mode"); + pComment->getTextView()->set_tooltip_text(SwResId(STR_COMMENT_EDIT_MODE)); mpAuthorSet.insert(pComment->GetAuthor()); mpCommentsMap[nNoteId] = std::move(pComment); } @@ -515,7 +515,7 @@ void CommentsPanel::addComment(const SwFormatField* pField) mpThreadsMap[nRootId] = std::move(pThread); setReferenceText(nRootId); pComment->InitControls(pNote->GetPostItField()); - pComment->getTextView()->set_tooltip_text("Edit Mode"); + pComment->getTextView()->set_tooltip_text(SwResId(STR_COMMENT_EDIT_MODE)); mpAuthorSet.insert(pComment->GetAuthor()); mpCommentsMap[nNoteId] = std::move(pComment); }