diff --git a/applications/tappytux/gameconfigform.lfm b/applications/tappytux/gameconfigform.lfm
index 3992c8691..572e1e37e 100644
--- a/applications/tappytux/gameconfigform.lfm
+++ b/applications/tappytux/gameconfigform.lfm
@@ -6,17 +6,14 @@ object Form1: TForm1
Caption = 'TappyTux Loader'
ClientHeight = 436
ClientWidth = 582
+ OnCreate = FormCreate
LCLVersion = '0.9.31'
object comboGameType: TComboBox
Left = 17
- Height = 23
+ Height = 21
Top = 38
Width = 100
- ItemHeight = 15
- Items.Strings = (
- 'Tappy Words'
- 'Tappy Math'
- )
+ ItemHeight = 0
OnChange = comboGameTypeChange
TabOrder = 0
Text = 'GameType'
@@ -31,9 +28,9 @@ object Form1: TForm1
end
object listWordlist: TLabel
Left = 208
- Height = 16
+ Height = 17
Top = 16
- Width = 79
+ Width = 93
Caption = 'Select Wordlist'
ParentColor = False
end
@@ -54,17 +51,17 @@ object Form1: TForm1
end
object lblSettings: TLabel
Left = 400
- Height = 16
+ Height = 17
Top = 16
- Width = 43
+ Width = 52
Caption = 'Settings'
ParentColor = False
end
object lblSound: TLabel
Left = 408
- Height = 16
+ Height = 17
Top = 47
- Width = 53
+ Width = 63
Caption = 'Sound FX'
Font.Style = [fsBold]
ParentColor = False
@@ -72,9 +69,9 @@ object Form1: TForm1
end
object lblMusic: TLabel
Left = 408
- Height = 16
+ Height = 17
Top = 79
- Width = 33
+ Width = 40
Caption = 'Music'
Font.Style = [fsBold]
ParentColor = False
@@ -82,9 +79,9 @@ object Form1: TForm1
end
object lblLevel: TLabel
Left = 408
- Height = 16
+ Height = 17
Top = 111
- Width = 79
+ Width = 93
Caption = 'Starting Level'
Font.Style = [fsBold]
ParentColor = False
@@ -92,10 +89,10 @@ object Form1: TForm1
end
object comboSound: TComboBox
Left = 493
- Height = 23
+ Height = 21
Top = 40
Width = 68
- ItemHeight = 15
+ ItemHeight = 0
Items.Strings = (
'ON'
'OFF'
@@ -105,10 +102,10 @@ object Form1: TForm1
end
object comboMusic: TComboBox
Left = 493
- Height = 23
+ Height = 21
Top = 72
Width = 68
- ItemHeight = 15
+ ItemHeight = 0
Items.Strings = (
'ON'
'OFF'
@@ -118,10 +115,10 @@ object Form1: TForm1
end
object comboLevel: TComboBox
Left = 493
- Height = 23
+ Height = 21
Top = 104
Width = 68
- ItemHeight = 15
+ ItemHeight = 0
Items.Strings = (
'1'
'2'
@@ -139,9 +136,9 @@ object Form1: TForm1
end
object lblCredits: TLabel
Left = 400
- Height = 16
+ Height = 17
Top = 168
- Width = 38
+ Width = 46
Caption = 'Credits'
ParentColor = False
end
@@ -188,9 +185,9 @@ object Form1: TForm1
end
object lblGameType: TLabel
Left = 16
- Height = 16
+ Height = 17
Top = 16
- Width = 58
+ Width = 67
Caption = 'GameType'
ParentColor = False
end
diff --git a/applications/tappytux/gameconfigform.pas b/applications/tappytux/gameconfigform.pas
index 557e80fc0..7048bb5e1 100644
--- a/applications/tappytux/gameconfigform.pas
+++ b/applications/tappytux/gameconfigform.pas
@@ -6,7 +6,8 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
- ExtCtrls;
+ ExtCtrls,
+ tappymodules;
type
@@ -30,10 +31,12 @@ type
memoGameType: TMemo;
memoCredits: TMemo;
procedure comboGameTypeChange(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
+ procedure TranslateUI();
end;
var
@@ -67,5 +70,24 @@ begin
end;
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+ TranslateUI();
+end;
+
+procedure TForm1.TranslateUI;
+var
+ i: Integer;
+ lModule: TTappyModule;
+begin
+ comboGameType.Items.Clear;
+ for i := 0 to GetModuleCount() - 1 do
+ begin
+ lModule := GetModule(i);
+ comboGameType.Items.Add(lModule.ShortDescription);
+ end;
+ comboGameType.ItemIndex := 0;
+end;
+
end.
diff --git a/applications/tappytux/mod_tappymath.pas b/applications/tappytux/mod_tappymath.pas
new file mode 100644
index 000000000..cabec68af
--- /dev/null
+++ b/applications/tappytux/mod_tappymath.pas
@@ -0,0 +1,44 @@
+unit mod_tappymath;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ Classes, SysUtils,
+ tappymodules;
+
+type
+
+ { TTappyMath }
+
+ TTappyMath = class(TTappyModule)
+ public
+ constructor Create; override;
+ procedure TranslateTextsToEnglish; override;
+ procedure TranslateTextsToPortuguese; override;
+ end;
+
+implementation
+
+{ TTappyWords }
+
+constructor TTappyMath.Create;
+begin
+ inherited Create;
+end;
+
+procedure TTappyMath.TranslateTextsToEnglish;
+begin
+ ShortDescription := 'TappyMath - A game to learn arithmetics';
+end;
+
+procedure TTappyMath.TranslateTextsToPortuguese;
+begin
+ ShortDescription := 'TappyMath - Um jogo para aprender aritmética';
+end;
+
+initialization
+ AddModule(TTappyMath.Create);
+end.
+
diff --git a/applications/tappytux/mod_tappywords.pas b/applications/tappytux/mod_tappywords.pas
index 50eb0a01f..0197e3df7 100644
--- a/applications/tappytux/mod_tappywords.pas
+++ b/applications/tappytux/mod_tappywords.pas
@@ -9,11 +9,36 @@ uses
tappymodules;
type
+
+ { TTappyWords }
+
TTappyWords = class(TTappyModule)
public
+ constructor Create; override;
+ procedure TranslateTextsToEnglish; override;
+ procedure TranslateTextsToPortuguese; override;
end;
implementation
+{ TTappyWords }
+
+constructor TTappyWords.Create;
+begin
+ inherited Create;
+end;
+
+procedure TTappyWords.TranslateTextsToEnglish;
+begin
+ ShortDescription := 'TappyWords - A game to learn typing and ortography';
+end;
+
+procedure TTappyWords.TranslateTextsToPortuguese;
+begin
+ ShortDescription := 'TappyWords - Um jogo para aprender a digitar e ortografia';
+end;
+
+initialization
+ AddModule(TTappyWords.Create);
end.
diff --git a/applications/tappytux/tappyconfig.pas b/applications/tappytux/tappyconfig.pas
index 499b791ae..ba4755ec0 100644
--- a/applications/tappytux/tappyconfig.pas
+++ b/applications/tappytux/tappyconfig.pas
@@ -20,6 +20,9 @@ type
const
STR_LINUX_RESOURCES_FOLDER = '/usr/share/tappytux/';
+ ID_ENGLISH = 0;
+ ID_PORTUGUESE = 1;
+
var
vTappyTuxConfig: TTappyTuxConfig;
diff --git a/applications/tappytux/tappymodules.pas b/applications/tappytux/tappymodules.pas
index 06616ff72..c012788e7 100644
--- a/applications/tappytux/tappymodules.pas
+++ b/applications/tappytux/tappymodules.pas
@@ -5,7 +5,8 @@ unit tappymodules;
interface
uses
- Classes, SysUtils, Graphics;
+ Classes, SysUtils, Graphics,
+ tappyconfig;
type
@@ -14,9 +15,13 @@ type
TTappyModule = class
public
imgBackground: TPortableNetworkGraphic;
+ ShortDescription, LongDescription: string;
constructor Create; virtual;
destructor Destroy; override;
procedure LoadImages; virtual;
+ procedure TranslateTexts(ALanguage: Integer);
+ procedure TranslateTextsToEnglish; virtual;
+ procedure TranslateTextsToPortuguese; virtual;
end;
procedure AddModule(AModule: TTappyModule);
@@ -61,6 +66,8 @@ end;
constructor TTappyModule.Create;
begin
inherited Create;
+
+ TranslateTexts(ID_ENGLISH);
end;
destructor TTappyModule.Destroy;
@@ -91,6 +98,24 @@ begin
end;
+procedure TTappyModule.TranslateTexts(ALanguage: Integer);
+begin
+ case ALanguage of
+ ID_ENGLISH: TranslateTextsToEnglish();
+ ID_PORTUGUESE: TranslateTextsToEnglish();
+ end;
+end;
+
+procedure TTappyModule.TranslateTextsToEnglish;
+begin
+
+end;
+
+procedure TTappyModule.TranslateTextsToPortuguese;
+begin
+
+end;
+
initialization
gTappyModules := TFPList.Create;
finalization
diff --git a/applications/tappytux/tappytux.lpi b/applications/tappytux/tappytux.lpi
index 0e7afe5ac..b0097625d 100644
--- a/applications/tappytux/tappytux.lpi
+++ b/applications/tappytux/tappytux.lpi
@@ -34,7 +34,7 @@
-
+
@@ -49,9 +49,9 @@
-
-
-
+
+
+
@@ -62,7 +62,7 @@
-
+
@@ -74,10 +74,10 @@
-
+
-
-
+
+
@@ -85,8 +85,7 @@
-
-
+
@@ -97,10 +96,10 @@
-
+
-
+
@@ -108,10 +107,10 @@
-
+
-
-
+
+
@@ -119,134 +118,146 @@
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/applications/tappytux/tappytux.lpr b/applications/tappytux/tappytux.lpr
index d2943b24b..9173f15a7 100644
--- a/applications/tappytux/tappytux.lpr
+++ b/applications/tappytux/tappytux.lpr
@@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, gameconfigform, gameplayform, tappyconfig, tappydrawer,
- tappygamedata, mod_tappywords, tappymodules
+ tappygamedata, mod_tappywords, tappymodules, mod_tappymath
{ you can add units after this };
{$R *.res}