Ignore:
Timestamp:
May 19, 2022, 10:39:34 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Use first capital letter in identifiers.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UTranslator.pas

    r424 r447  
    420420
    421421  if Lang = '' then begin
    422     for i := 1 to Paramcount - 1 do
    423       if (ParamStr(i) = '--LANG') or (ParamStr(i) = '-l') or
    424         (ParamStr(i) = '--lang') then
    425         Lang := ParamStr(i + 1);
     422    for I := 1 to Paramcount - 1 do
     423      if (ParamStr(I) = '--LANG') or (ParamStr(I) = '-l') or
     424        (ParamStr(I) = '--lang') then
     425        Lang := ParamStr(I + 1);
    426426  end;
    427427  if Lang = '' then begin
     
    473473      DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    474474    if FileExistsUTF8(Result) then
    475       exit;
     475      Exit;
    476476
    477477    Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator + LangID +
    478478      DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    479479    if FileExistsUTF8(Result) then
    480       exit;
     480      Exit;
    481481
    482482    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
    483483      + LangID + DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    484484    if FileExistsUTF8(Result) then
    485       exit;
     485      Exit;
    486486
    487487    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
     
    489489      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    490490    if FileExistsUTF8(Result) then
    491       exit;
     491      Exit;
    492492
    493493    {$IFDEF UNIX}
     
    496496      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    497497    if FileExistsUTF8(Result) then
    498       exit;
     498      Exit;
    499499    {$ENDIF}
    500500    // Let us search for reducted files
    501     LangShortID := copy(LangID, 1, 2);
     501    LangShortID := Copy(LangID, 1, 2);
    502502    // At first, check all was checked
    503503    Result := ExtractFilePath(ParamStrUTF8(0)) + LangShortID +
    504504      DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    505505    if FileExistsUTF8(Result) then
    506       exit;
     506      Exit;
    507507
    508508    Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator +
     
    510510      ExtractFileName(ParamStrUTF8(0)), LCExt);
    511511    if FileExistsUTF8(Result) then
    512       exit;
     512      Exit;
    513513
    514514    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
     
    516516      ExtractFileName(ParamStrUTF8(0)), LCExt);
    517517    if FileExistsUTF8(Result) then
    518       exit;
     518      Exit;
    519519
    520520    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
     
    522522      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    523523    if FileExistsUTF8(Result) then
    524       exit;
     524      Exit;
    525525
    526526    // Full language in file name - this will be default for the project
     
    529529      Result := ExtractFilePath(ParamStrUTF8(0)) + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt;
    530530      if FileExistsUTF8(Result) then
    531         exit;
     531        Exit;
    532532      // Common location (like in Lazarus)
    533533      Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator +
    534534        ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt;
    535535      if FileExistsUTF8(Result) then
    536         exit;
     536        Exit;
    537537
    538538      Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' +
    539539        DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt;
    540540      if FileExistsUTF8(Result) then
    541         exit;
     541        Exit;
    542542    except
    543543      Result := ''; // Or do something else (useless)
     
    548548      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    549549    if FileExistsUTF8(Result) then
    550       exit;
     550      Exit;
    551551    {$ENDIF}
    552552    Result := ExtractFilePath(ParamStrUTF8(0)) + ChangeFileExt(
    553553      ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt;
    554554    if FileExistsUTF8(Result) then
    555       exit;
     555      Exit;
    556556
    557557    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator +
    558558      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt;
    559559    if FileExistsUTF8(Result) then
    560       exit;
     560      Exit;
    561561
    562562    Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator +
    563563      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt;
    564564    if FileExistsUTF8(Result) then
    565       exit;
     565      Exit;
    566566  end;
    567567
Note: See TracChangeset for help on using the changeset viewer.