Issue #557: Override automatic language detection via registry setting "Language".

This commit is contained in:
Ansgar Becker
2012-11-13 22:06:07 +00:00
parent 4a6f9da93a
commit 783a9d146e
2 changed files with 6 additions and 1 deletions

View File

@@ -47,6 +47,8 @@ uses
{$R ..\..\res\manifest.RES}
{$R ..\..\res\updater.RES}
var
AppLanguage: String;
begin
// Use MySQL standard format for date/time variables: YYYY-MM-DD HH:MM:SS
// Be aware that Delphi internally converts the slashes in ShortDateFormat to the DateSeparator
@@ -61,6 +63,8 @@ begin
AppSettings.Free;
Application.Terminate;
end else begin
AppLanguage := AppSettings.ReadString(asAppLanguage);
UseLanguage(AppLanguage);
Application.Initialize;
Application.Title := APPNAME;
Application.UpdateFormatSettings := False;

View File

@@ -172,7 +172,7 @@ type
asFieldEditorSet, asFieldNullBackground, asGroupTreeObjects, asDisplayObjectSizeColumn, asSQLfile,
asActionShortcut1, asActionShortcut2, asHighlighterForeground, asHighlighterBackground, asHighlighterStyle,
asListColWidths, asListColsVisible, asListColPositions, asListColSort, asSessionFolder,
asRecentFilter, asDateTimeEditorCursorPos);
asRecentFilter, asDateTimeEditorCursorPos, asAppLanguage);
TAppSetting = record
Name: String;
Session: Boolean;
@@ -3113,6 +3113,7 @@ begin
InitSetting(asSessionFolder, 'Folder', 0, False);
InitSetting(asRecentFilter, '%s', 0, False, '', True);
InitSetting(asDateTimeEditorCursorPos, 'DateTimeEditor_CursorPos_Type%s', 0);
InitSetting(asAppLanguage, 'Language', 0, False, '');
end;