Skip to content

Commit

Permalink
Translate the One Page Button and Two Page Button on the Print Preive…
Browse files Browse the repository at this point in the history
…w toolbar.
  • Loading branch information
sdottaka committed Nov 11, 2023
1 parent e7b2cae commit d021044
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Src/MergeEditFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,29 @@ void CMergeEditFrame::OnIdleUpdateCmdUI()
CMergeFrameCommon::OnIdleUpdateCmdUI();
}

LRESULT CMergeEditFrame::CPreviewNumPageButton::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_SETTEXT:
{
// Translate the One Page Button and Two Page Button on the Print Preivew toolbar.
String text = reinterpret_cast<TCHAR*>(lParam);
String translated = tr(text);
if (translated != text)
{
SetWindowText(translated.c_str());
return TRUE;
}
break;
}
case WM_DESTROY:
UnsubclassWindow();
break;
}
return __super::WindowProc(message, wParam, lParam);
}

void CMergeEditFrame::OnTimer(UINT_PTR nIDEvent)
{
if (nIDEvent == IDT_SAVEPOSITION)
Expand All @@ -406,6 +429,7 @@ void CMergeEditFrame::OnTimer(UINT_PTR nIDEvent)
{
pPreviewBar->Invalidate();
theApp.TranslateDialog(pPreviewBar->GetSafeHwnd());
m_wndPreviewNumPage.SubclassWindow(pPreviewBar->GetDlgItem(AFX_ID_PREVIEW_NUMPAGE)->GetSafeHwnd());
}
}
else
Expand Down
4 changes: 4 additions & 0 deletions Src/MergeEditFrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class CMergeEditFrame : public CMergeFrameCommon
CMergeEditSplitterView *m_pwndDetailMergeEditSplitterView;
CMergeStatusBar m_wndStatusBar;
CLocationBar m_wndLocationBar;
class CPreviewNumPageButton : public CButton
{
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
} m_wndPreviewNumPage;

// Overrides
public:
Expand Down

3 comments on commit d021044

@Need74
Copy link
Contributor

@Need74 Need74 commented on d021044 Nov 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi
thank you for this happy news

I tried on my Win-merge to modify the french.po file but unfortunately it does not work on my version 2.16.34.
I know that I will have to wait for the new version to be able to integrate the translation because I do not master the compilation of source files or the use of MS Visual Studio.

However, I noticed while doing my tests that the translation proposal does not include all the items on the page.

It is curiously missing

msgid "&Next Page"
msgid ""

msgid "&Close"
msgid ""

I guess this is just a small oversight and I wanted to point it out right away, before the new version is released.

Sincerely
Dennis

@sdottaka
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you noticed, "&Next Page" and "&Close" were not added to the .pot file because they already existed.
The latest WinMerge can be downloaded from below.
https://github.com/WinMerge/winmerge/actions/runs/6835685987
or
https://ci.appveyor.com/project/sdottaka/winmerge/build/artifacts

@Need74
Copy link
Contributor

@Need74 Need74 commented on d021044 Nov 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi
Thanks for the link to the updated version, I was able to test and everything works perfectly now.
Cordially
Dennis

Please sign in to comment.