From bf367bbb5a79349898e9372b686010cd3a6979ec Mon Sep 17 00:00:00 2001 From: riderkick Date: Fri, 12 Jun 2015 15:28:34 +0800 Subject: [PATCH] updater, fix translations use fixed appname --- updater/uMain.pas | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/updater/uMain.pas b/updater/uMain.pas index e60708b1d..7b6f377bf 100644 --- a/updater/uMain.pas +++ b/updater/uMain.pas @@ -9,9 +9,9 @@ interface cthreads, cmem, {$endif} - Classes, SysUtils, zipper, FileUtil, UTF8Process, Forms, Dialogs, - ComCtrls, StdCtrls, Clipbrd, ExtCtrls, DefaultTranslator, RegExpr, IniFiles, - process, USimpleException, uMisc, httpsend, blcksock, ssl_openssl; + Classes, SysUtils, zipper, FileUtil, UTF8Process, Forms, Dialogs, ComCtrls, + StdCtrls, Clipbrd, ExtCtrls, DefaultTranslator, RegExpr, IniFiles, process, + USimpleException, uMisc, uTranslation, httpsend, blcksock, ssl_openssl; type @@ -616,6 +616,9 @@ procedure TfrmMain.FormCreate(Sender :TObject); begin Randomize; InitSimpleExceptionHandler(ChangeFileExt(Application.ExeName, '.log')); + uTranslation.LangDir := GetCurrentDirUTF8 + PathDelim + 'languages'; + uTranslation.LangAppName := 'updater'; + uTranslation.CollectLanguagesFiles; InitCriticalSection(CS_ReadCount); //load proxy config from fmd config := TIniFile.Create('config/config.ini'); @@ -679,7 +682,9 @@ procedure TfrmMain.FormShow(Sender :TObject); else if s = '-r' then _MaxRetry := StrToIntDef(ParamStrUTF8(i + 1), 1) else if s = '-l' then - _LaunchApp := ParamStrUTF8(i + 1); + _LaunchApp := ParamStrUTF8(i + 1) + else if (LowerCase(s) = '--lang') then + uTranslation.SetLang(ParamStrUTF8(i + 1)); end; end; end;