Ignore:
Timestamp:
Sep 9, 2007, 2:02:29 PM (18 years ago)
Author:
RBRi
Message:

refactoring for language handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/GlobalSearchForm.pas

    r191 r228  
    318318
    319319Procedure TGlobalSearchForm.OnLanguageEvent(Language: TLanguageFile; const Apply: boolean );
    320 begin
    321   LogEvent(LogI18n, 'TGlobalSearchForm.OnLanguageEvent apply: "' + BoolToStr(Apply) + '"');
     320var
     321  tmpPrefix : String;
     322begin
     323  // LogEvent(LogI18n, 'TGlobalSearchForm.OnLanguageEvent apply: "' + BoolToStr(Apply) + '"');
    322324
    323325  Language.LoadComponentLanguage(self, Apply);
    324326
    325   Language.LL(Apply, SearchCaption, 'SearchCaption', '~Search');
    326   Language.LL(Apply, StopCaption, 'StopCaption', '~Stop');
    327   Language.LL(Apply, NoResultsMsg, 'NoResultsMsg', '(No results found)');
    328   Language.LL(Apply, ScanDirectoriesMsg, 'ScanDirectoriesMsg', 'Finding help files...');
    329   Language.LL(Apply, SearchingFileMsg, 'SearchingFileMsg', 'Searching ');
    330   Language.LL(Apply, OfMsg, 'OfMsg', ' of ');
    331   Language.LL(Apply, DoneMsg, 'DoneMsg', 'Done');
    332   Language.LL(Apply, SearchErrorTitle, 'SearchErrorTitle', 'Search');
    333   Language.LL(Apply, SearchError, 'SearchError', 'Error in search syntax: ');
    334 
    335   Language.LL(Apply, StandardHelpPathsLocation, 'StandardHelpPathsLocation', 'Standard Help Paths');
    336   Language.LL(Apply, FixedDrivesLocation, 'FixedDrivesLocation', 'All Hard Drives');
    337   Language.LL(Apply, SelectedHelpPathsLocation, 'SelectedHelpPathsLocation', 'Selected Help Paths');
    338   Language.LL(Apply, CustomPathsLocation, 'CustomPathsLocation', 'Directory List');
     327  tmpPrefix := 'GlobalSearchForm' + LANGUAGE_LABEL_DELIMITER;
     328
     329  Language.LL(Apply, SearchCaption, tmpPrefix + 'SearchCaption', '~Search');
     330  Language.LL(Apply, StopCaption, tmpPrefix + 'StopCaption', '~Stop');
     331  Language.LL(Apply, NoResultsMsg, tmpPrefix + 'NoResultsMsg', '(No results found)');
     332  Language.LL(Apply, ScanDirectoriesMsg, tmpPrefix + 'ScanDirectoriesMsg', 'Finding help files...');
     333  Language.LL(Apply, SearchingFileMsg, tmpPrefix + 'SearchingFileMsg', 'Searching ');
     334  Language.LL(Apply, OfMsg, tmpPrefix + 'OfMsg', ' of ');
     335  Language.LL(Apply, DoneMsg, tmpPrefix + 'DoneMsg', 'Done');
     336  Language.LL(Apply, SearchErrorTitle, tmpPrefix + 'SearchErrorTitle', 'Search');
     337  Language.LL(Apply, SearchError, tmpPrefix + 'SearchError', 'Error in search syntax: ');
     338
     339  Language.LL(Apply, StandardHelpPathsLocation, tmpPrefix + 'StandardHelpPathsLocation', 'Standard Help Paths');
     340  Language.LL(Apply, FixedDrivesLocation, tmpPrefix + 'FixedDrivesLocation', 'All Hard Drives');
     341  Language.LL(Apply, SelectedHelpPathsLocation, tmpPrefix + 'SelectedHelpPathsLocation', 'Selected Help Paths');
     342  Language.LL(Apply, CustomPathsLocation, tmpPrefix + 'CustomPathsLocation', 'Directory List');
    339343end;
    340344
     
    403407Procedure TGlobalSearchForm.GlobalSearchFormOnCreate (Sender: TObject);
    404408Begin
    405   RegisterForLanguages( OnLanguageEvent );
     409  RegisterEventForLanguages( OnLanguageEvent );
    406410
    407411  UpdateButtons;
     
    749753  RegisterClasses ([TGlobalSearchForm, TEdit, TLabel,
    750754    TProgressBar, TButton, TOutline2, TComboBox, TBevel, TLed, TTimer]);
    751   RegisterUpdateProcForLanguages( EnsureGlobalSearchFormLoaded );
     755
     756  RegisterUpdateProcForLanguages(EnsureGlobalSearchFormLoaded);
    752757End.
Note: See TracChangeset for help on using the changeset viewer.