Mark system cursor names translatable in a context, and do get translation

It looks like wxGetTranslation() was not actually called for these strings
earlier, so do call it.

The context fulfills also the same purpose as TRANSLATORS: comments --
removing comments as redundant.
This commit is contained in:
Lauri Nurmi 2022-04-24 11:17:56 +03:00
parent 3396a40015
commit 180b8e5183
2 changed files with 35 additions and 28 deletions

View File

@ -265,6 +265,7 @@ class WXDLLIMPEXP_PROPGRID wxCursorProperty : public wxEnumProperty
int value = 0 ); int value = 0 );
virtual ~wxCursorProperty(); virtual ~wxCursorProperty();
virtual wxString ValueToString(wxVariant& value, int argFlags = 0) const wxOVERRIDE;
virtual wxSize OnMeasureImage( int item ) const wxOVERRIDE; virtual wxSize OnMeasureImage( int item ) const wxOVERRIDE;
virtual void OnCustomPaint( wxDC& dc, virtual void OnCustomPaint( wxDC& dc,
const wxRect& rect, wxPGPaintData& paintdata ) wxOVERRIDE; const wxRect& rect, wxPGPaintData& paintdata ) wxOVERRIDE;

View File

@ -1650,34 +1650,34 @@ wxVariant wxColourProperty::DoTranslateVal( wxColourPropertyValue& v ) const
#define NUM_CURSORS 28 #define NUM_CURSORS 28
static const char* const gs_cp_es_syscursors_labels[NUM_CURSORS+1] = { static const char* const gs_cp_es_syscursors_labels[NUM_CURSORS+1] = {
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Default"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Default"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Arrow"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Arrow"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Right Arrow"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Right Arrow"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Blank"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Blank"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Bullseye"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Bullseye"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Character"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Character"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Cross"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Cross"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Hand"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Hand"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("I-Beam"), wxTRANSLATE_IN_CONTEXT("system cursor name", "I-Beam"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Left Button"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Left Button"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Magnifier"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Magnifier"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Middle Button"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Middle Button"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("No Entry"), wxTRANSLATE_IN_CONTEXT("system cursor name", "No Entry"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Paint Brush"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Paint Brush"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Pencil"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Pencil"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Point Left"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Point Left"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Point Right"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Point Right"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Question Arrow"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Question Arrow"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Right Button"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Right Button"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing NE-SW"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Sizing NE-SW"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing N-S"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Sizing N-S"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing NW-SE"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Sizing NW-SE"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing W-E"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Sizing W-E"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Sizing"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Spraycan"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Spraycan"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Wait"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Wait"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Watch"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Watch"),
/* TRANSLATORS: System cursor name */ wxTRANSLATE("Wait Arrow"), wxTRANSLATE_IN_CONTEXT("system cursor name", "Wait Arrow"),
NULL NULL
}; };
@ -1732,6 +1732,12 @@ wxCursorProperty::~wxCursorProperty()
{ {
} }
wxString wxCursorProperty::ValueToString(wxVariant& value, int argFlags) const
{
return wxGetTranslation(wxEnumProperty::ValueToString(value, argFlags),
wxString(), "system cursor name");
}
wxSize wxCursorProperty::OnMeasureImage( int item ) const wxSize wxCursorProperty::OnMeasureImage( int item ) const
{ {
#if wxPG_CAN_DRAW_CURSOR #if wxPG_CAN_DRAW_CURSOR