Ignore:
Timestamp:
Jun 19, 2024, 11:15:44 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
File:
1 moved

Legend:

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

    r314 r315  
    1 unit ULanguages;
    2 
    3 {$mode delphi}{$H+}
     1unit Languages;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, fgl;
     6  Classes, SysUtils, Generics.Collections;
    97
    108type
     
    1715  { TLanguages }
    1816
    19   TLanguages = class(TFPGObjectList<TLanguage>)
     17  TLanguages = class(TObjectList<TLanguage>)
    2018    function SearchByCode(ACode: string): TLanguage;
    2119    procedure AddNew(Code: string; Name: string);
     
    218216  SLang_za = 'Zhuang';
    219217  SLang_zh = 'Chinese';
     218  SLang_zh_Hans = 'Simplified Chinese';
     219  SLang_zh_Hant = 'Traditional Chinese';
    220220  SLang_zu = 'Zulu';
     221
    221222
    222223implementation
     
    230231begin
    231232  I := 0;
    232   while (I < Count) and (TLanguage(Items[I]).Code < ACode) do Inc(I);
    233   if I < Count then Result := TLanguage(Items[I])
     233  while (I < Count) and (Items[I].Code <> ACode) do Inc(I);
     234  if I < Count then Result := Items[I]
    234235    else Result := nil;
    235236end;
     
    441442  AddNew('za', SLang_za);
    442443  AddNew('zh', SLang_zh);
     444  AddNew('zh-Hant', SLang_zh_Hant);
     445  AddNew('zh-Hans', SLang_zh_Hans);
    443446  AddNew('zu', SLang_zu);
    444447end;
    445448
    446449end.
    447 
Note: See TracChangeset for help on using the changeset viewer.