Recent

Author Topic: Wiki: переводы статей  (Read 37222 times)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #45 on: December 30, 2022, 10:18:18 pm »
Добавил перевод по пользовательским аттрибутам

Custom Attributes
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #46 on: January 01, 2023, 04:25:04 pm »
Добавил перевод по быстрому поиску в исходниках
Lazarus InstantSearch
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #47 on: September 11, 2023, 06:14:37 pm »
Добавил перевод статьи
LNet
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #48 on: October 25, 2024, 09:22:57 pm »
Добавил перевод статьи
Поиск важных каталогов macOS
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #49 on: February 26, 2025, 01:20:41 pm »
Добавил перевод статьи
FPReport
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #50 on: March 01, 2025, 08:10:15 pm »
Добавил перевод статьи
Использование FPReport
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #51 on: February 22, 2026, 05:12:42 pm »
Сделал при помощи AI перевод LazPaint :)
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

n7800

  • Hero Member
  • *****
  • Posts: 672
  • Lazarus IDE contributor
    • GitLab profile
Re: Wiki: переводы статей
« Reply #52 on: February 22, 2026, 08:51:23 pm »
Так перевод сделал ИИ или ВЫ?  :D

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #53 on: February 23, 2026, 12:14:24 am »
Так перевод сделал ИИ или ВЫ?  :D
Rus: Естественно, я. ИИ - всего лишь экскаватор в руках землекопа.

Eng: In this case, AI is just a tool that eliminates routine operations. In the end, I was pressing keys on the keyboard and thinking with my head. So, all the laurels go to me.

 :)
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #54 on: March 03, 2026, 09:08:33 pm »
Добавил перевод "Визуальный конструктор отчётов FPReport" (соавтор ИИ, претензии к нему) :)
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #55 on: March 30, 2026, 09:37:49 am »
Доделал давно начатый перевод Документация по TAChart. Гляньте на корректность. Половину делал сам, половину ИИ. Если есть замечания - кидайте сюда - поправлю
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

Thaddy

  • Hero Member
  • *****
  • Posts: 18918
  • Glad to be alive.
Re: Wiki: переводы статей
« Reply #56 on: March 30, 2026, 12:31:54 pm »
Добавил перевод по пользовательским аттрибутам
Custom Attributes
@zoltanleo

I wrote the original complete example for the attributes entry, but I have just added a much better example.
Maybe you can adapt your translation?
I have commented it slightly better. Apart from json serialization, the fun part is the [jsonignore] attribute.
The code is:
Code: Pascal  [Select][+][-]
  1. program AttributeSerializerDemo;
  2. {$ifdef fpc}{$mode delphi}{$H+}{$endif}
  3. {$apptype console}
  4. uses
  5.   SysUtils, TypInfo, Rtti;
  6. // ---------------------------------------------------------------------------
  7. // Custom attributes
  8. // ---------------------------------------------------------------------------
  9. type
  10. {$ifndef fpc for Delphi compatibility}
  11.   TCustomAttributeArray = Tarray<TCustomAttribute>;
  12.   TStringArray = TArray<string>;
  13. const
  14.     LineEnding = {$ifdef mswindows}#13#10{$else}#10{$endif};
  15. type
  16. {$endif}
  17.  
  18.   { Maps a property to a specific JSON key name }
  19.   JsonNameAttribute = class(TCustomAttribute)
  20.   private
  21.     FName: string;
  22.   public
  23.     constructor Create(const AName: string);virtual;
  24.     property Name: string read FName;
  25.   end;
  26.  
  27.   { Marks a property to be excluded from serialization }
  28.   JsonIgnoreAttribute = class(TCustomAttribute)
  29.   constructor create;
  30.   end;
  31.  
  32. constructor JsonNameAttribute.Create(const AName: string);
  33. begin
  34.   FName := AName;
  35. end;
  36.  
  37. constructor JsonIgnoreAttribute.Create;
  38. begin
  39.   inherited create;
  40. end;
  41. // ---------------------------------------------------------------------------
  42. // A realistic model class using the attributes
  43. // ---------------------------------------------------------------------------
  44. type
  45.   [JsonName('user')]
  46.   TUserProfile = class
  47.   private
  48.     FFirstName: string;
  49.     FLastName:  string;
  50.     FEmail:     string;
  51.     FAge:       Integer;
  52.     FPassword:  string;
  53.   published
  54.     [JsonName('first_name')]
  55.     property FirstName: string  read FFirstName write FFirstName;
  56.  
  57.     [JsonName('last_name')]
  58.     property LastName:  string  read FLastName  write FLastName;
  59.  
  60.     { No attribute → property name used as-is, lowercased }
  61.     property Email:     string  read FEmail     write FEmail;
  62.  
  63.     property Age:       Integer read FAge       write FAge;
  64.  
  65.     [JsonIgnore]
  66.     property Password:  string  read FPassword  write FPassword;
  67.   end;
  68. // ---------------------------------------------------------------------------
  69. // The serializer — reads attributes via RTTI at runtime
  70. // ---------------------------------------------------------------------------
  71. type
  72.   TJsonSerializer = class
  73.   public
  74.     class function Serialize(AObject: TObject): string;
  75.   end;
  76.  
  77. class function TJsonSerializer.Serialize(AObject: TObject): string;
  78. var
  79.   Ctx      : TRttiContext;
  80.   RttiType : TRttiType;
  81.   Prop     : TRttiProperty;
  82.   Attrs    : TCustomAttributeArray;
  83.   Attr     : TCustomAttribute;
  84.   JsonKey  : string;
  85.   Skip     : Boolean;
  86.   Value    : TValue;
  87.   Parts    : TStringArray;
  88.   I        : Integer;
  89. begin
  90.   Ctx      := TRttiContext.Create;
  91.   try
  92.     RttiType := Ctx.GetType(AObject.ClassType);
  93.     Parts := Default(TStringArray);
  94.     for Prop in RttiType.GetProperties do
  95.     begin
  96.       if Prop.Visibility <> mvPublished then
  97.         Continue;
  98.       // Scan this property's attributes
  99.       JsonKey := LowerCase(Prop.Name);   // default key
  100.       Skip    := False;
  101.       Attrs   := Prop.GetAttributes;
  102.       for Attr in Attrs do
  103.       begin
  104.         if Attr is JsonIgnoreAttribute then
  105.           Skip := True
  106.         else if Attr is JsonNameAttribute then
  107.           JsonKey := JsonNameAttribute(Attr).Name;
  108.       end;
  109.       if Skip then
  110.         Continue;
  111.       Value := Prop.GetValue(AObject);
  112.       // Build a simple "key": value pair
  113.       SetLength(Parts, Length(Parts) + 1);
  114.       case Prop.PropertyType.TypeKind of
  115.         tkInteger, tkInt64:
  116.           Parts[High(Parts)] := Format('  "%s": %s', [JsonKey, Value.ToString]);
  117.       else
  118.         Parts[High(Parts)] := Format('  "%s": "%s"', [JsonKey, Value.AsString]);
  119.       end;
  120.     end;
  121.     // Assemble the JSON object
  122.     Result := '{' + LineEnding;
  123.     for I := 0 to High(Parts) do
  124.     begin
  125.       Result := Result + Parts[I];
  126.       if I < High(Parts) then
  127.         Result := Result + ',';
  128.       Result := Result + LineEnding;
  129.     end;
  130.     Result := Result + '}';
  131.   finally
  132.     Ctx.Free;
  133.   end;
  134. end;
  135. // ---------------------------------------------------------------------------
  136. // Demo
  137. // ---------------------------------------------------------------------------
  138. var
  139.   User: TUserProfile;
  140. begin
  141.   User           := TUserProfile.Create;
  142.   User.FirstName := 'Ada';
  143.   User.LastName  := 'Lovelace';
  144.   User.Email     := 'ada@babbage.io';
  145.   User.Age       := 36;
  146.   User.Password  := 's3cr3t!';   // should NOT appear in output
  147.   WriteLn(TJsonSerializer.Serialize(User));
  148.   User.Free;
  149. end.

This example is much more useful in real-world scenarios and is Delphi compatible.

Keep up the good work!
« Last Edit: March 30, 2026, 01:08:26 pm by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #57 on: March 30, 2026, 01:15:24 pm »
I wrote the original complete example for the attributes entry, but I have just added a much better example.Keep up the good work!

Hi Thaddy

Thanks for the announcement. Added changes to the article
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Hero Member
  • *****
  • Posts: 515
Re: Wiki: переводы статей
« Reply #58 on: April 05, 2026, 07:30:26 pm »
Исправил давно сделанный перевод статьи Настройка отладчика.

Замечания приветствуются
Win10 LTSC x64/Deb 12 amd64(gtk2)/Kubuntu(qt5)/Darwin Cocoa x86_64 (Sequoia):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 3.0.11; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

Seenkao

  • Hero Member
  • *****
  • Posts: 751
    • New ZenGL.
Re: Wiki: переводы статей
« Reply #59 on: April 05, 2026, 09:18:01 pm »
zoltanleo, просто как рекомендации. На твоё усмотрение.

Quote
В Windows файл должен находиться в папке «mingw\bin\» в каталоге, где установлен Lazarus.
заменить на
Quote
В Windows файл должен находиться в папке «mingw\bin\» в каталоге, где установлен Lazarus (mingw должен быть предварительно установлен).

----------------------------------------------------------------------
Quote
Для отладки проекта необходимо указать IDE компилировать его особым образом, предоставляя дополнительную информацию, необходимую отладчику.
заменить на
Quote
Для отладки проекта, требуется настроить проект:
1. Нажмите в пункте "Build modes" (Режимы сборки) кнопку с троеточием (или возможно у вас там значёк показывающий настроку), откроется новое окно и там выберите "Create Debug and Release modes" (Создать режимы отладочной и конечной сборки).
2. Выберите пункт "Default" и нажмите кнопку "-" (данный режим удалится).
3. Выберите пункт "Debug", закройте окно.

Далее, вы можете выбирать между режимами Debug и Release в настройках проекта, теперь достаточно будет только нажать на кнопку за "Build modes" (Режимы сборки).

----------------------------------------------------------------------
Quote
Не следует включать «Использовать внешние отладочные символы»
заменить на
Quote
Не желательно включать «Использовать внешние отладочные символы»
(ниже идёт дополнительное указание).

----------------------------------------------------------------------
Quote
Можно использовать «Режимы сборки». Кнопка «...» открывает диалог для создания режимов «release» и «debug». В этом случае всё равно следует проверить значение «Тип отладочной информации».
возможно удалить? Если будешь менять на предложенное выше. Или переформулировать, но первое предложение всё равно можно удалить.

----------------------------------------------------------------------
Quote
Используйте оптимизацию «Уровень 0» («Уровень 1» допустим, но в некоторых случаях может вызывать проблемы)
заменить на
Quote
Желательно использовать оптимизацию «-O0» («-O1» допустим, но всё что выше уровня оптимизации «-O0» в некоторых случаях может вызывать проблемы при отладке данных)

то же самое с Link Smart, заменить на "не желательно".

Ну и вообще желательно там же пробежаться по флажкам, указывающих для чего они нужны и что их можно отключать в некоторых ситуациях (но не желательно).


А вообще тема отладки достаточно глобальная, там наверно можно увеличивать статью раза в три. )))

Благодарю за работу!
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

 

TinyPortal © 2005-2018