  TSecondLang-Component
  Two languages in one application!
  (c) by Christian Bang, cbang@gmx.de
  Freeware!
  First Build: 98 07 22
  Cur.  Build: 98 07 23

You need Delphi 3!
Installation: 
  I guess, you know how to add a component.
Usage:
  Every WinControl can use two languages.
  Control.Tag <> 0: the Control will not be
  added in the SecondLang object list.
  Other changes made by the language change can
  be made via the OnLangChange event.
  A second language can be activated by setting the
  SecondLanguage property to true.
  If all other instances of TSecondLang in other
  forms should be swiched by swiching only one you
  can set the GlobalUpdate property to true.
  If you want to use TSecondLang in your Sourcecode
  you can use the simple function Lang(s1,s2)
  that returns eigther language string 1 or 2.
  Use TStaticText instead of TLabel if you want
  the labels be translatable.
Source code:
  If you want the source, please email me so that I can
  see who is interested in it (feedback).
  The code documentation is in German - sorry.
}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, comctrls;

type
  TWC = (wcGet, wcSet);
  TSecondLang = class(TComponent)
  private
    { Private-Deklarationen }
    FSecondLanguage: boolean;
    FLangChange: TNotifyEvent;
    FGlobalUpdate: boolean;
    procedure SetSecondLanguage(State: boolean);
  protected
    { Protected-Deklarationen }
    { Jeder Eintrag:
      Componentname +#0+
      Text in der anderen Sprache }
    ControlList: TStringList;
    procedure DoLangChange(Sender: TObject); dynamic;
    procedure WindowContens(mode: TWC; WinCtrl: TWinControl; var s: string); dynamic;
    procedure ReadProp(Reader: TReader);
    procedure WriteProp(Writer: TWriter);
    procedure Loaded; override;
  public
    { Public-Deklarationen }
    constructor Create(Owner: TComponent); override;
    destructor Destroy; override;
    procedure DefineProperties(Filer: TFiler); override;
    procedure UpdateOtherSL;
  published
    { Published-Deklarationen }
    property SecondLanguage: boolean read FSecondLanguage write SetSecondLanguage;
    property OnLangChange: TNotifyEvent read FLangChange write FLangChange;
    property GlobalUpdate: boolean read FGlobalUpdate write FGlobalUpdate;
  end;

procedure Register;

function Lang(s1,s2: string): string;
{ Zur Benutzung im Quelltext:
    Bsp.: Lang('Beispiel', 'Example') liefert
    je nach Einstellung enweder 'Beispiel' oder
    'Example'.}

var
  // Speichert den Zustand, der letzten nderung
  // der zuletzt genderten Instanz von SecondLang.
  // Wenn GlobalUpdate=true ist, ist der Ausdruck
  // ernst zu nehmen.
  GlobalSecondLang: boolean;

