diff --git a/interface/wx/translation.h b/interface/wx/translation.h index abe020ff73..0da0e20c1b 100644 --- a/interface/wx/translation.h +++ b/interface/wx/translation.h @@ -466,29 +466,28 @@ public: initialization. Here is an example which should make it more clear: suppose that you have a - static array of strings containing the weekday names and which have to be - translated (note that it is a bad example, really, as wxDateTime already - can be used to get the localized week day names already). If you write: + static array of strings containing the names of chemical elements, which + have to be translated. If you write: @code - static const char * const weekdays[] = { _("Mon"), ..., _("Sun") }; + static const char * const elements[] = { _("Hydrogen"), _("Helium"), ... }; ... - // use weekdays[n] as usual + // use elements[n] as usual @endcode The code wouldn't compile because the function calls are forbidden in the array initializer. So instead you should do this: @code - static const char * const weekdays[] = { wxTRANSLATE("Mon"), ..., - wxTRANSLATE("Sun") }; + static const char * const elements[] = { wxTRANSLATE("Hydrogen"), + wxTRANSLATE("Helium"), ... }; ... - // use wxGetTranslation(weekdays[n]) + // use wxGetTranslation(elements[n]) @endcode Note that although the code @b would compile if you simply omit wxTRANSLATE() in the above, it wouldn't work as expected because there - would be no translations for the weekday names in the program message + would be no translations for the element names in the program message catalog and wxGetTranslation() wouldn't find them. @return A const wxChar*.