class %IPM.ResourceProcessor.LocalizationExport
extends %IPM.ResourceProcessor.Abstract
Resource processor to automatically export messages in given list of domains to a particular file after compilation.
This works with a resource like /localize/MessageFileName.xml (Domains attribute required; resource name used as export target), or
MyPackage.Errors.LOC (Filename attribute required; Domains populated automatically from the message file)
For .LOC resources, the default resource processor class (%IPM.ResourceProcessor.Default.LocalizedMessages) should be used instead.
parameter ATTRIBUTES = "Domains,Filename";
Comma-separated list of resource attribute names that this processor uses
parameter DESCRIPTION = "Exports messages for localization after the module is compiled.";
Description of resource processor class (shown in UI)
property Domains
as %String(MAXLEN="");
Comma-separated list of domains to export to the specified file. For .LOC documents, this is determined automatically and is not overridable.
property Filename
as %String(MAXLEN=255);
Filename to export to. For .LOC documents, this is required; otherwise, this is set to the resource name and is not overridable.
method GetDomainsForResource()
as %String
Returns a comma-separated list of domains for the specified resource.
classmethod GetMessageFile(pDocName As %String, Output pFileObject As %IPM.ResourceProcessor.LocalizationExport.MsgFile)
as %Status
pDocName is the full document name (including the .LOC extension)
pFileObject is an instance of %IPM.ResourceProcessor.LocalizationExport.MsgFile corresponding to the document's content.
@API.Method
@Modifier Availability InterSystems
method OnBeforePhase(pPhase As %String, ByRef pParams)
as %Status
classmethod SaveMessageFile(pDocName As %String, pFileObject As %IPM.ResourceProcessor.LocalizationExport.MsgFile, pCompile As %Boolean = 1, Output pConsoleOutput)
as %Status
pDocName is the full document name (including the .LOC extension)
pFileObject is an instance of %IPM.ResourceProcessor.LocalizationExport.MsgFile corresponding to the document's content.
If pCompile is set to 1 (by default, it is), then the file will be compiled after save.
pConsoleOutput is an integer-subscripted array of lines of output from everything that happened.
@API.Method
@Modifier Availability InterSystems