Added some hints for translators in wxPG.

Because context of some texts to be translated can be unclear added some instructions for translators which can be extracted by gettext or similar tools.
This commit is contained in:
Artur Wieczorek
2015-05-16 17:05:03 +02:00
parent 12f69f7603
commit 08f9e27351
2 changed files with 66 additions and 54 deletions

View File

@@ -644,6 +644,7 @@ wxFontProperty::wxFontProperty( const wxString& label, const wxString& name,
wxFont font; wxFont font;
font << m_value; font << m_value;
/* TRANSLATORS: Label of font point size */
AddPrivateChild( new wxIntProperty( _("Point Size"), AddPrivateChild( new wxIntProperty( _("Point Size"),
wxS("Point Size"),(long)font.GetPointSize() ) ); wxS("Point Size"),(long)font.GetPointSize() ) );
@@ -653,6 +654,7 @@ wxFontProperty::wxFontProperty( const wxString& label, const wxString& name,
wxPGGlobalVars->m_fontFamilyChoices->Index(faceName) == wxNOT_FOUND ) wxPGGlobalVars->m_fontFamilyChoices->Index(faceName) == wxNOT_FOUND )
wxPGGlobalVars->m_fontFamilyChoices->AddAsSorted(faceName); wxPGGlobalVars->m_fontFamilyChoices->AddAsSorted(faceName);
/* TRANSLATORS: Label of font face name */
wxPGProperty* p = new wxEnumProperty(_("Face Name"), wxS("Face Name"), wxPGProperty* p = new wxEnumProperty(_("Face Name"), wxS("Face Name"),
*wxPGGlobalVars->m_fontFamilyChoices); *wxPGGlobalVars->m_fontFamilyChoices);
@@ -660,17 +662,21 @@ wxFontProperty::wxFontProperty( const wxString& label, const wxString& name,
AddPrivateChild( p ); AddPrivateChild( p );
/* TRANSLATORS: Label of font style */
AddPrivateChild( new wxEnumProperty(_("Style"), wxS("Style"), AddPrivateChild( new wxEnumProperty(_("Style"), wxS("Style"),
gs_fp_es_style_labels,gs_fp_es_style_values, gs_fp_es_style_labels,gs_fp_es_style_values,
font.GetStyle()) ); font.GetStyle()) );
/* TRANSLATORS: Label of font weight */
AddPrivateChild( new wxEnumProperty(_("Weight"), wxS("Weight"), AddPrivateChild( new wxEnumProperty(_("Weight"), wxS("Weight"),
gs_fp_es_weight_labels,gs_fp_es_weight_values, gs_fp_es_weight_labels,gs_fp_es_weight_values,
font.GetWeight()) ); font.GetWeight()) );
/* TRANSLATORS: Label of underlined font */
AddPrivateChild( new wxBoolProperty(_("Underlined"), wxS("Underlined"), AddPrivateChild( new wxBoolProperty(_("Underlined"), wxS("Underlined"),
font.GetUnderlined()) ); font.GetUnderlined()) );
/* TRANSLATORS: Label of font family */
AddPrivateChild( new wxEnumProperty(_("Family"), wxS("PointSize"), AddPrivateChild( new wxEnumProperty(_("Family"), wxS("PointSize"),
gs_fp_es_family_labels,gs_fp_es_family_values, gs_fp_es_family_labels,gs_fp_es_family_values,
font.GetFamily()) ); font.GetFamily()) );
@@ -849,31 +855,31 @@ void wxFontProperty::OnCustomPaint(wxDC& dc,
//#define wx_cp_es_syscolours_len 25 //#define wx_cp_es_syscolours_len 25
static const char* const gs_cp_es_syscolour_labels[] = { static const char* const gs_cp_es_syscolour_labels[] = {
wxTRANSLATE("AppWorkspace"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("AppWorkspace"),
wxTRANSLATE("ActiveBorder"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("ActiveBorder"),
wxTRANSLATE("ActiveCaption"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("ActiveCaption"),
wxTRANSLATE("ButtonFace"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("ButtonFace"),
wxTRANSLATE("ButtonHighlight"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("ButtonHighlight"),
wxTRANSLATE("ButtonShadow"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("ButtonShadow"),
wxTRANSLATE("ButtonText"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("ButtonText"),
wxTRANSLATE("CaptionText"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("CaptionText"),
wxTRANSLATE("ControlDark"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("ControlDark"),
wxTRANSLATE("ControlLight"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("ControlLight"),
wxTRANSLATE("Desktop"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("Desktop"),
wxTRANSLATE("GrayText"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("GrayText"),
wxTRANSLATE("Highlight"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("Highlight"),
wxTRANSLATE("HighlightText"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("HighlightText"),
wxTRANSLATE("InactiveBorder"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("InactiveBorder"),
wxTRANSLATE("InactiveCaption"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("InactiveCaption"),
wxTRANSLATE("InactiveCaptionText"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("InactiveCaptionText"),
wxTRANSLATE("Menu"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("Menu"),
wxTRANSLATE("Scrollbar"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("Scrollbar"),
wxTRANSLATE("Tooltip"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("Tooltip"),
wxTRANSLATE("TooltipText"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("TooltipText"),
wxTRANSLATE("Window"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("Window"),
wxTRANSLATE("WindowFrame"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("WindowFrame"),
wxTRANSLATE("WindowText"), /* TRANSLATORS: Keyword of system colour */ wxTRANSLATE("WindowText"),
wxTRANSLATE("Custom"), /* TRANSLATORS: Custom colour choice entry */ wxTRANSLATE("Custom"),
NULL NULL
}; };
@@ -1525,6 +1531,7 @@ bool wxSystemColourProperty::DoSetAttribute( const wxString& name, wxVariant& va
if ( ival && (m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) ) if ( ival && (m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) )
{ {
// Show custom choice // Show custom choice
/* TRANSLATORS: Custom colour choice entry */
m_choices.Add(_("Custom"), wxPG_COLOUR_CUSTOM); m_choices.Add(_("Custom"), wxPG_COLOUR_CUSTOM);
m_flags &= ~(wxPG_PROP_HIDE_CUSTOM_COLOUR); m_flags &= ~(wxPG_PROP_HIDE_CUSTOM_COLOUR);
} }
@@ -1563,7 +1570,7 @@ static const char* const gs_cp_es_normcolour_labels[] = {
wxTRANSLATE("Aqua"), wxTRANSLATE("Aqua"),
wxTRANSLATE("Yellow"), wxTRANSLATE("Yellow"),
wxTRANSLATE("White"), wxTRANSLATE("White"),
wxTRANSLATE("Custom"), /* TRANSLATORS: Custom colour choice entry */ wxTRANSLATE("Custom"),
NULL NULL
}; };
@@ -1703,34 +1710,34 @@ wxVariant wxColourProperty::DoTranslateVal( wxColourPropertyValue& v ) const
//#define wx_cp_es_syscursors_len 28 //#define wx_cp_es_syscursors_len 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] = {
wxTRANSLATE("Default"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Default"),
wxTRANSLATE("Arrow"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Arrow"),
wxTRANSLATE("Right Arrow"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Right Arrow"),
wxTRANSLATE("Blank"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Blank"),
wxTRANSLATE("Bullseye"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Bullseye"),
wxTRANSLATE("Character"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Character"),
wxTRANSLATE("Cross"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Cross"),
wxTRANSLATE("Hand"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Hand"),
wxTRANSLATE("I-Beam"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("I-Beam"),
wxTRANSLATE("Left Button"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Left Button"),
wxTRANSLATE("Magnifier"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Magnifier"),
wxTRANSLATE("Middle Button"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Middle Button"),
wxTRANSLATE("No Entry"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("No Entry"),
wxTRANSLATE("Paint Brush"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Paint Brush"),
wxTRANSLATE("Pencil"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Pencil"),
wxTRANSLATE("Point Left"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Point Left"),
wxTRANSLATE("Point Right"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Point Right"),
wxTRANSLATE("Question Arrow"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Question Arrow"),
wxTRANSLATE("Right Button"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Right Button"),
wxTRANSLATE("Sizing NE-SW"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing NE-SW"),
wxTRANSLATE("Sizing N-S"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing N-S"),
wxTRANSLATE("Sizing NW-SE"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing NW-SE"),
wxTRANSLATE("Sizing W-E"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing W-E"),
wxTRANSLATE("Sizing"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Sizing"),
wxTRANSLATE("Spraycan"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Spraycan"),
wxTRANSLATE("Wait"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Wait"),
wxTRANSLATE("Watch"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Watch"),
wxTRANSLATE("Wait Arrow"), /* TRANSLATORS: System cursor name */ wxTRANSLATE("Wait Arrow"),
NULL NULL
}; };

View File

@@ -204,7 +204,9 @@ wxPGGlobalVarsClass::wxPGGlobalVarsClass()
{ {
wxPGProperty::sm_wxPG_LABEL = new wxString(wxPG_LABEL_STRING); wxPGProperty::sm_wxPG_LABEL = new wxString(wxPG_LABEL_STRING);
/* TRANSLATORS: Name of Boolean false value */
m_boolChoices.Add(_("False")); m_boolChoices.Add(_("False"));
/* TRANSLATORS: Name of Boolean true value */
m_boolChoices.Add(_("True")); m_boolChoices.Add(_("True"));
m_fontFamilyChoices = NULL; m_fontFamilyChoices = NULL;
@@ -404,6 +406,7 @@ void wxPropertyGrid::Init1()
m_width = m_height = 0; m_width = m_height = 0;
/* TRANSLATORS: Text displayed for unspecified value */
m_commonValues.push_back(new wxPGCommonValue(_("Unspecified"), wxPGGlobalVars->m_defaultRenderer) ); m_commonValues.push_back(new wxPGCommonValue(_("Unspecified"), wxPGGlobalVars->m_defaultRenderer) );
m_cvUnspecified = 0; m_cvUnspecified = 0;
@@ -3174,6 +3177,7 @@ void wxPropertyGrid::DoShowPropertyError( wxPGProperty* WXUNUSED(property), cons
} }
#endif #endif
/* TRANSLATORS: Caption of message box displaying any property error */
::wxMessageBox(msg, _("Property Error")); ::wxMessageBox(msg, _("Property Error"));
} }
@@ -3306,6 +3310,7 @@ bool wxPropertyGrid::DoOnValidationFailure( wxPGProperty* property, wxVariant& W
DoShowPropertyError(property, msg); DoShowPropertyError(property, msg);
if ( vfb & wxPG_VFB_SHOW_MESSAGEBOX ) if ( vfb & wxPG_VFB_SHOW_MESSAGEBOX )
/* TRANSLATORS: Caption of message box displaying any property error */
::wxMessageBox(msg, _("Property Error")); ::wxMessageBox(msg, _("Property Error"));
} }