summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec98030)
raw | patch | inline | side by side (parent: ec98030)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 27 May 2023 13:47:31 +0000 (16:47 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 27 May 2023 13:59:12 +0000 (16:59 +0300) |
src/editor/f_options.pas | patch | blob | history |
index 51f2ea698f63a1d6e8f62ebf069195e0fc95923e..aa7012f58f987771b474f9153853a64c0fd2218f 100644 (file)
--- a/src/editor/f_options.pas
+++ b/src/editor/f_options.pas
implementation
uses
- LazFileUtils, StrUtils, f_main, StdConvs, CONFIG, g_language, g_resources, g_options;
+ LazFileUtils, f_main, StdConvs, CONFIG, g_language, g_resources, g_options;
{$R *.lfm}
end;
procedure TOptionsForm.FormActivate(Sender: TObject);
- var info: TSearchRec; s: String; i: Integer;
+ const langfilename = 'editor';
+ var info: TSearchRec;
begin
sDotColor.Brush.Color := DotColor;
cbShowDots.Checked := DotEnable;
cbLanguage.Items.BeginUpdate;
cbLanguage.Items.Clear;
cbLanguage.Items.Add('Auto');
- if FindFirst(LangDir + DirectorySeparator + '*.mo', faAnyFile, info) = 0 then
+ if FindFirst(LangDir + DirectorySeparator + langfilename + '.*.mo', faAnyFile, info) = 0 then
begin
repeat
- s := ExtractFileNameWithoutExt(info.Name);
- // TODO: check encoding part in name (editor.ru_RU.UTF-8.mo)
- i := Max(RPos('.', s), 1);
- s := Copy(s, i + 1, Length(s) - i);
- cbLanguage.Items.Add(s);
+ cbLanguage.Items.Add(Copy(ExtractFileNameWithoutExt(info.Name), Length(langfilename) + 2));
until FindNext(info) <> 0;
FindClose(info);
end;