[SOLVED] Visibility of resourcestring lazarus / 21-General ---------------------------------------------------------------------- CM630 · 2023-11-18 11:26 I am reading this: https://wiki.freepascal.org/Step-by- step_instructions_for_creating_multi-language_applications It is stated: QuoteIn a larger project, it is convenient to collect all resourcestrings in a separate unit; you can access the strings from other forms and units and avoid cross-referencing of units this way. So I made a new project, enabled i18N. The project has one main form, I created a unit named localize. I added it in the Uses of the main form. And when I did showmsg (lngOK) I get: „Error: Identifier not found "lngOk"“  What am I doing wrong? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit localize;   {$mode ObjFPC}{$H+}  interface  uses  Classes, SysUtils;  implementation  resourcestring  lngOk = 'Okay';  end. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit main;   {$mode objfpc}{$H+}  interface  uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,  localize, LCLTranslator;  type    { TForm1 }    TForm1 = class(TForm)    Button1: TButton;    procedure Button1Click(Sender: TObject);  private    public    end;  var  Form1: TForm1;  implementation  {$R *.lfm}  { TForm1 }  procedure TForm1.Button1Click(Sender: TObject);begin  ShowMessage (lngOk);end;  end. ---------------------------------------------------------------------- Paolo · 2023-11-18 12:07 Move the resourcestring in the interface section may help ---------------------------------------------------------------------- CM630 · 2023-11-18 12:11 Moving to Interface results in „Fatal: Syntax error, "IMPLEMENTATION" expected but "USES" found“ But moving after USES seems works! Thanks! WORKING Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit localize;  {$mode ObjFPC}{$H+}  interface  uses  Classes, SysUtils;  resourcestring  lngOk = 'Okay';  implementation  end.   NOT WORKING Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  unit localize;  {$mode ObjFPC}{$H+}  interface  resourcestring  lngOk = 'Okay';  uses  Classes, SysUtils;  implementation end. ---------------------------------------------------------------------- PascalDragon · 2023-11-19 17:41 Quote from: CM630 on November 18, 2023, 01:11:30 pmMoving to Interface results in „Fatal: Syntax error, "IMPLEMENTATION" expected but "USES" found“ The whole area from interface up until implementation is the “interface section”. So if someone says “move xyz to the interface section” they'll mean to the syntatically correct place, in this case after the uses-clause of the interface section.