unit uMessages;
{$INCLUDE 'Filters.inc'}

interface

uses
  {$INCLUDE 'DelphiFarUnits.inc'} ;

type
  TMessages = (
    MNoLngStringDefined = -1,
    //
    MTitle = 0,
    //
    MOK,
    MCancel,
    MYes,
    MNo,
    MReturnToEditor,
    MSkip,
    MErase,
    MRetry,
    MNew,
    MCopy,
    MDelete,
    MEdit,
    MUp,
    MDown,
    //
    MExceptionOccurredIn,
    //
    MFailedToReadEditorInfo,
    MFailedToReadEditorFileName,
    MFailedToReadEditorContent,
    MFailedToSelectAllContent,
    MFailedToDeleteOldContent,
    MFailedToInsertNewContent,
    //
    MUnknownFilter,
    MConfigNotFound,
    MConfigNotActive,
    MFiltersFailedToLoad,
    //
    MColumnBlocksNotSupported,
    //
    MSelectFilter,
    //
    MNoFiltersRegistered,
    MSelectFilterType,
    MDescription,
    MWildcard,
    MEditBeforeUse,
    MSaveFilterContent,
    //
    MFilterAutoSelectName,
    MFilterAutoSelectDescription,
    MNoApplicableFilterFound,
    //
    MFilterXmlFormatName,
    MFilterXmlFormatDescription,
    //
    MFilterJSONFormatName,
    MFilterJSONFormatDescription,
    //
    MFilterHTMLName,
    MFilterHTMLDescription,
    MFailedToExecuteELinks,
    MFailedToExecuteELinks_ResultCode,
    MFailedToChangeCWD,
    MCallingElinks,
    //
    MFilterExternalName,
    MFilterExternalDescription,
    MUnknownEncoding,
    MInvalidStreamEncoding,
    MUnexpectedPercentageSign,
    MUnexpectedPercentageModifier,
    MInputFileNameNotUsed,
    MInputFileNameMayNotBeUsed,
    MOutputFileNameNotUsed,
    MOutputFileNameMayNotBeUsed,
    MInvalidEnumValue,
    MCommandLineTemplate,
    MInputSource,
    MInputSourceHint,
    MInputEncoding,
    MInputBOM,
    MOutputSource,
    MOutputSourceHint,
    MOutputEncoding,
    MCommandLineTemplateNotSet,
    MInvalidCommandLineTemplate,
    MFailedToExecuteCommandLine,
    MExternalCommandReturnedError,
    MInvalidValueForInputSource,
    MInvalidValueForOutputSource,
    MInvalidValueForEncoding,
    MANSI,
    MOEM,
    MUTF8,
    MUTF16,
    MStdIn,
    MStdOut,
    MStdErr,
    MStdOutErr,
    MFile,
    // These must be at the end!! They are not expected to be translated
    MDummyLastString
  );

function GetMsg(MsgID: TMessages): string;

implementation

function GetMsg(MsgID: TMessages): string;
begin
  if MsgID = MNoLngStringDefined then
    Result := ''
  else
    Result := TFarPlugin.Instance.GetLangString(TIntPtr(MsgID));
end;

end.
