*****************************************************************************/\r
\r
#include <vcl.h>\r
+#include <comctrls.hpp>\r
#pragma hdrstop\r
\r
#include <vlc/vlc.h>\r
****************************************************************************/\r
void __fastcall Translate( TForm *Form )\r
{\r
-#if 0\r
- Form->Hint = _( Form->Hint.c_str() );\r
- Form->Caption = _( Form->Caption.c_str() );\r
+ // We must test the string because we don't want to get the default one\r
+ if( Form->Hint != "" )\r
+ {\r
+ Form->Hint = _( Form->Hint.c_str() );\r
+ }\r
+ if( Form->Caption != "" )\r
+ {\r
+ Form->Caption = _( Form->Caption.c_str() );\r
+ }\r
\r
- int i;\r
- for( i = 0; i < Form->ComponentCount; i++ )\r
+ for( int i = 0; i < Form->ComponentCount; i++ )\r
{\r
// Does this component need a translation ?\r
if( Form->Components[i]->Tag > 0 )\r
{\r
TComponent *Component = Form->Components[i];\r
\r
+ // Note: the Text property isn't translated, because we don't want\r
+ // to modify the content of TEdit or TComboBox objects, which\r
+ // may have default values\r
+\r
// Hint property\r
if( Component->Tag & 1 )\r
{\r
if( Component->InheritsFrom( __classid( TControl ) ) )\r
{\r
TControl *Object = (TControl *) Component;\r
- Object->Hint = _( Object->Hint.c_str() );\r
+ if( Object->Hint != "" )\r
+ {\r
+ Object->Hint = _( Object->Hint.c_str() );\r
+ }\r
}\r
else if( Component->InheritsFrom( __classid( TMenuItem ) ) )\r
{\r
TMenuItem *Object = (TMenuItem *) Component;\r
- Object->Hint = _( Object->Hint.c_str() );\r
+ if( Object->Hint != "" )\r
+ {\r
+ Object->Hint = _( Object->Hint.c_str() );\r
+ }\r
}\r
}\r
\r
if( Component->InheritsFrom( __classid( TMenuItem ) ) )\r
{\r
TMenuItem *Object = (TMenuItem *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
- }\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
+ }\r
else if( Component->InheritsFrom( __classid( TLabel ) ) )\r
{\r
TLabel *Object = (TLabel *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
}\r
else if( Component->InheritsFrom( __classid( TButton ) ) )\r
{\r
TButton *Object = (TButton *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
- }\r
- else if( Component->InheritsFrom( __classid( TToolButton ) ) )\r
- {\r
- TToolButton *Object = (TToolButton *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
}\r
else if( Component->InheritsFrom( __classid( TRadioButton ) ) )\r
{\r
TRadioButton *Object = (TRadioButton *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
}\r
else if( Component->InheritsFrom( __classid( TCheckBox ) ) )\r
{\r
TCheckBox *Object = (TCheckBox *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
}\r
else if( Component->InheritsFrom( __classid( TRadioGroup ) ) )\r
{\r
TRadioGroup *Object = (TRadioGroup *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
}\r
else if( Component->InheritsFrom( __classid( TGroupBox ) ) )\r
{\r
TGroupBox *Object = (TGroupBox *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
}\r
- else if( Component->InheritsFrom( __classid( TTabSheet ) ) )\r
+#if 0\r
+ else if( Component->InheritsFrom( __classid( TToolButton ) ) )\r
{\r
- TTabSheet *Object = (TTabSheet *) Component;\r
- Object->Caption = _( Object->Caption.c_str() );\r
+ TToolButton *Object = (TToolButton *) Component;\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
}\r
+#endif\r
else if( Component->InheritsFrom( __classid( TListView ) ) )\r
{\r
- TListView *Object = (TListView *) Component;\r
- int iCol;\r
- for( iCol = 0; iCol < Object->Columns->Count; iCol++ )\r
- Object->Columns->Items[iCol]->Caption =\r
- _( Object->Columns->Items[iCol]->Caption.c_str() );\r
- }\r
- }\r
-\r
- // Text property\r
- if( Component->Tag & 4 )\r
- {\r
- if( Component->InheritsFrom( __classid( TEdit ) ) )\r
- {\r
- TEdit *Object = (TEdit *) Component;\r
- Object->Text = _( Object->Text.c_str() );\r
- }\r
- else if( Component->InheritsFrom( __classid( TComboBox ) ) )\r
- {\r
- TComboBox *Object = (TComboBox *) Component;\r
- Object->Text = _( Object->Text.c_str() );\r
+ TListView *ListView = (TListView *) Component;\r
+ for( int iCol = 0; iCol < ListView->Columns->Count; iCol++ )\r
+ {\r
+ TListColumn *Object = ListView->Columns->Items[iCol];\r
+ if( Object->Caption != "" )\r
+ {\r
+ Object->Caption = _( Object->Caption.c_str() );\r
+ }\r
+ }\r
}\r
}\r
}\r
}\r
-#endif\r
}\r
\r