From 11b15978b14f9e263adf3145519f186d5f775bec Mon Sep 17 00:00:00 2001 From: Blake-Madden <66873089+Blake-Madden@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:47:56 -0500 Subject: [PATCH] i18n fixes --- src/base/image.h | 5 ++++- src/data/dataset.h | 4 +++- src/graphs/barchart.cpp | 4 +++- src/graphs/piechart.cpp | 8 ++++++-- src/graphs/sankeydiagram.cpp | 4 +++- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/base/image.h b/src/base/image.h index 31c2f981..84ab81d1 100644 --- a/src/base/image.h +++ b/src/base/image.h @@ -178,7 +178,10 @@ namespace Wisteria::GraphItems static wxString GetImageFileFilter() { return _( - LR"(Image Files (*.bmp;*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.tga;*.tif;*.tiff;*.pcx)|*.bmp;*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.tga;*.tif;*.tiff;*.pcx|Bitmap (*.bmp)|*.bmp|JPEG (*.jpg;*.jpeg;*.jpe)|*.jpg;*.jpg;*.jpe|PNG (*.png)|*.png|GIF (*.gif)|*.gif|Targa (*.tga)|*.tga|TIFF (*.tif;*.tiff)|*.tif;*.tiff|PCX (*.pcx)|*.pcx)"); + LR"(Image Files (*.bmp;*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.tga;*.tif;*.tiff;*.pcx)|" + "*.bmp;*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.tga;*.tif;*.tiff;*.pcx|Bitmap (*.bmp)|*.bmp|" + "JPEG (*.jpg;*.jpeg;*.jpe)|*.jpg;*.jpg;*.jpe|PNG (*.png)|*.png|GIF (*.gif)|*.gif|" + "Targa (*.tga)|*.tga|TIFF (*.tif;*.tiff)|*.tif;*.tiff|PCX (*.pcx)|*.pcx)"); } /** @brief Loads image and adjusts its JPEG orientation (if necessary). diff --git a/src/data/dataset.h b/src/data/dataset.h index 4b0487a0..6f55353d 100644 --- a/src/data/dataset.h +++ b/src/data/dataset.h @@ -1728,7 +1728,9 @@ namespace Wisteria::Data static wxString GetDataFileFilter() { return _( - LR"(All Data Files (*.txt;*.csv;*.xlsx)|*.txt;*.csv;*.xlsx|Tab Delimited Files (*.txt)|*.txt|CSV Files (*.csv)|*.csv|Excel Files (*.xlsx)|*.xlsx)"); + LR"(All Data Files (*.txt;*.csv;*.xlsx)|*.txt;*.csv;*.xlsx|" + "Tab Delimited Files (*.txt)|*.txt|CSV Files (*.csv)|*.csv|" + "Excel Files (*.xlsx)|*.xlsx)"); } /// @} diff --git a/src/graphs/barchart.cpp b/src/graphs/barchart.cpp index cc9d9d93..09d2c2b4 100644 --- a/src/graphs/barchart.cpp +++ b/src/graphs/barchart.cpp @@ -42,7 +42,9 @@ namespace Wisteria::Graphs Settings::GetDefaultNumberFormat())) : (GetBinLabelDisplay() == BinLabelDisplay::BinNameAndPercentage) ? bar.GetAxisLabel().GetText() + - wxString::Format(L" (%s%%)", + wxString::Format( + // TRANSLATORS: Percent value (%s) and percentage symbol (%%) + _(L" (%s%%)"), wxNumberFormatter::ToString(percentage, (percentage < 1) ? 2 : 0, wxNumberFormatter::Style::Style_NoTrailingZeroes)) : (GetBinLabelDisplay() == BinLabelDisplay::BinValue) ? diff --git a/src/graphs/piechart.cpp b/src/graphs/piechart.cpp index 928c6733..e161c05b 100644 --- a/src/graphs/piechart.cpp +++ b/src/graphs/piechart.cpp @@ -56,7 +56,9 @@ namespace Wisteria::GraphItems Settings::GetDefaultNumberFormat()))); break; case BinLabelDisplay::BinNameAndPercentage: - pieLabel->SetText(wxString::Format(L"%s\n(%s%%)", + pieLabel->SetText(wxString::Format( + // TRANSLATORS: Pie chart label and then a percentage value in parentheses + _(L"%s\n(%s%%)"), pieLabel->GetText(), percStr)); break; @@ -201,7 +203,9 @@ namespace Wisteria::GraphItems wxNumberFormatter::ToString(m_value, 0, Settings::GetDefaultNumberFormat()))); break; case BinLabelDisplay::BinNameAndPercentage: - pieLabel->SetText(wxString::Format(L"%s (%s%%)", pieLabel->GetText(), percStr)); + pieLabel->SetText(wxString::Format( + // TRANSLATORS: Pie chart label and then a percentage value in parentheses + _(L"%s (%s%%)"), pieLabel->GetText(), percStr)); break; case BinLabelDisplay::BinName: [[fallthrough]]; diff --git a/src/graphs/sankeydiagram.cpp b/src/graphs/sankeydiagram.cpp index aa383fb3..cd015dd7 100644 --- a/src/graphs/sankeydiagram.cpp +++ b/src/graphs/sankeydiagram.cpp @@ -430,7 +430,9 @@ namespace Wisteria::Graphs wxNumberFormatter::ToString(group.m_frequency, 0, wxNumberFormatter::Style::Style_WithThousandsSep)) : (GetGroupLabelDisplay() == BinLabelDisplay::BinPercentage) ? - wxString::Format(L"%s%%", + wxString::Format( + // TRANSLATORS: Percent value placeholder and percentage symbol (%%) + _(L"%s%%"), wxNumberFormatter::ToString(group.m_percentOfColumn * 100, 0)) : (GetGroupLabelDisplay() == BinLabelDisplay::BinValue) ? wxString::Format(L"%s",