TvPlanIt: Fix translation issues in fulldemo.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8345 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-07-12 10:25:34 +00:00
parent bb0b4d368c
commit cf88b7c792
2 changed files with 35 additions and 52 deletions

View File

@ -4,21 +4,20 @@ object MainForm: TMainForm
Top = 134 Top = 134
Width = 959 Width = 959
Caption = 'Turbo Power VisualPlanIt Demo' Caption = 'Turbo Power VisualPlanIt Demo'
ClientHeight = 576 ClientHeight = 596
ClientWidth = 959 ClientWidth = 959
Menu = MainMenu1 Menu = MainMenu1
OnCloseQuery = FormCloseQuery OnCloseQuery = FormCloseQuery
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '2.3.0.0'
object Panel1: TPanel object Panel1: TPanel
Left = 125 Left = 125
Height = 576 Height = 596
Top = 0 Top = 0
Width = 834 Width = 834
Align = alClient Align = alClient
AutoSize = True AutoSize = True
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 576 ClientHeight = 596
ClientWidth = 834 ClientWidth = 834
TabOrder = 0 TabOrder = 0
object HeaderPanel: TPanel object HeaderPanel: TPanel
@ -56,7 +55,7 @@ object MainForm: TMainForm
end end
object Notebook: TNotebook object Notebook: TNotebook
Left = 0 Left = 0
Height = 528 Height = 548
Top = 48 Top = 48
Width = 834 Width = 834
PageIndex = 0 PageIndex = 0
@ -66,18 +65,18 @@ object MainForm: TMainForm
object Events: TPage object Events: TPage
object LeftPanel: TPanel object LeftPanel: TPanel
Left = 0 Left = 0
Height = 528 Height = 548
Top = 0 Top = 0
Width = 357 Width = 357
Align = alLeft Align = alLeft
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 528 ClientHeight = 548
ClientWidth = 357 ClientWidth = 357
TabOrder = 0 TabOrder = 0
object VpMonthView1: TVpMonthView object VpMonthView1: TVpMonthView
Left = 0 Left = 0
Height = 197 Height = 197
Top = 331 Top = 351
Width = 357 Width = 357
ShowHint = True ShowHint = True
ControlLink = VpControlLink1 ControlLink = VpControlLink1
@ -112,14 +111,14 @@ object MainForm: TMainForm
Cursor = crVSplit Cursor = crVSplit
Left = 0 Left = 0
Height = 5 Height = 5
Top = 326 Top = 346
Width = 357 Width = 357
Align = alBottom Align = alBottom
ResizeAnchor = akBottom ResizeAnchor = akBottom
end end
object VpDayView1: TVpDayView object VpDayView1: TVpDayView
Left = 0 Left = 0
Height = 292 Height = 312
Top = 34 Top = 34
Width = 357 Width = 357
ShowHint = True ShowHint = True
@ -295,13 +294,13 @@ object MainForm: TMainForm
end end
object Splitter3: TSplitter object Splitter3: TSplitter
Left = 357 Left = 357
Height = 528 Height = 548
Top = 0 Top = 0
Width = 5 Width = 5
end end
object VpWeekView1: TVpWeekView object VpWeekView1: TVpWeekView
Left = 362 Left = 362
Height = 528 Height = 548
Top = 0 Top = 0
Width = 472 Width = 472
ShowHint = True ShowHint = True
@ -746,7 +745,7 @@ object MainForm: TMainForm
end end
object VpNavBar1: TVpNavBar object VpNavBar1: TVpNavBar
Left = 0 Left = 0
Height = 576 Height = 596
Top = 0 Top = 0
Width = 120 Width = 120
ActiveFolder = 0 ActiveFolder = 0
@ -847,7 +846,7 @@ object MainForm: TMainForm
end end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 120 Left = 120
Height = 576 Height = 596
Top = 0 Top = 0
Width = 5 Width = 5
end end

View File

@ -973,46 +973,29 @@ begin
langdir := AppendPathDelim(GetLanguageDir); langdir := AppendPathDelim(GetLanguageDir);
// Select new language // Select new language
if ALang = 'en' then
FLang := ''
else
FLang := ALang; FLang := ALang;
if FLang = '' then begin SetDefaultLang(FLang, langdir);
// Translate VisualPlanIt strings.
TranslateUnitResourceStrings('vpsr', langdir + 'vpsr.po');
{ NOTE: Translation of app strings back to english not working } // Translate VisualPlanIt strings.
TranslateUnitResourceStrings('vpsr', langdir + 'vpsr.' + FLang + '.po');
// Translate demo strings // Translate demo strings
TranslateUnitResourceStrings('demoMain', langDir + 'demo.po'); TranslateUnitResourceStrings('demoMain', langDir + 'demo.' + FLang + '.po');
// Translate LCL strings (please copy lclstrconsts.* from Lazarus/lcl/langauges // Translate LCL strings (please copy lclstrconsts.* from Lazarus/lcl/langauges
// to tvplanit/languages. // to tvplanit/languages.
TranslateUnitResourceStrings('lclstrconsts', langDir + 'lclstrconsts.po'); TranslateUnitResourceStrings('lclstrconsts', langDir + 'lclstrconsts.' + FLang + '.po');
if FileExistsUTF8(langdir + 'demo.po') then begin if FileExistsUTF8(langdir + 'demo.' + FLang + '.po') then begin
translator := TPOTranslator.Create(langdir + 'demo.po'); translator := TPOTranslator.Create(langdir + 'demo.' + FLang + '.po');
if Assigned(LRSTranslator) then if Assigned(LRSTranslator) then
LRSTranslator.Free; LRSTranslator.Free;
LRSTranslator := translator; LRSTranslator := translator;
for i := 0 to Screen.CustomFormCount-1 do for i := 0 to Screen.CustomFormCount-1 do
translator.UpdateTranslation(Screen.CustomForms[i]); translator.UpdateTranslation(Screen.CustomForms[i]);
end; end;
end
else
begin
SetDefaultLang(FLang, langdir);
TranslateUnitResourceStrings('vpsr', langdir + 'vpsr.' + FLang + '.po');
end;
{
VpDayView1.LoadLanguage;
VpWeekView1.LoadLanguage;
VpMonthView1.LoadLanguage;
VpTaskList1.LoadLanguage;
VpContactGrid1.LoadLanguage;
//VpCalendar1.LoadLanguage;
}
// Select language in language combobox. // Select language in language combobox.
if ALang = '' then ALang := 'en'; if ALang = '' then ALang := 'en';
found := false; found := false;
@ -1069,7 +1052,7 @@ begin
OpenDialog.Filter := rsXMLFiles + '|*.xml'; OpenDialog.Filter := rsXMLFiles + '|*.xml';
// Next settings work correctly only for Windows. // These settings work correctly only for Windows.
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
UpdateFormatSettings(ALang); UpdateFormatSettings(ALang);
VpDayView1.DateLabelFormat := FormatSettings.LongDateFormat; VpDayView1.DateLabelFormat := FormatSettings.LongDateFormat;
@ -1082,6 +1065,7 @@ begin
VpWeekView1.TimeFormat := tfmt; VpWeekView1.TimeFormat := tfmt;
VpMonthView1.TimeFormat := tfmt; VpMonthView1.TimeFormat := tfmt;
{$ENDIF} {$ENDIF}
firstWeekDay := GetFirstDayofWeek(ALang); // not correct at the moment firstWeekDay := GetFirstDayofWeek(ALang); // not correct at the moment
VpMonthView1.WeekStartsOn := firstWeekDay; VpMonthView1.WeekStartsOn := firstWeekDay;
VpWeekView1.WeekStartsOn := firstWeekDay; VpWeekView1.WeekStartsOn := firstWeekDay;