LRM msg Support

From Lingoport Wiki
Jump to: navigation, search

Example of .msg files as well as file extensions using the msg parser type

$ A Globalyzer generated message file

$set MainSet

$  SOURCE_FILE C:/Path/to/my/source/StringBug.hpp
STRI_BADLINE_6 "Bad line"
STRI_INVALID_7 "Invalid Rectangle"
STRI_INVALID_8 "Invalid Color"
STRI_INVALID_9 "Invalid Point"
STRI_INVALID_10 "Invalid DWORD"
STRI_UNRECOG_11 "Unrecognized type"
STRI_SLINEDS_12 "%s (line #%d) : %s"
STRI_RUNTIME_13 "Runtime Variable Error"
STRI_KEYNOTF_14 "Key not found"

$  SOURCE_FILE C:/Path/to/my/source/keypressEvents.cxx
KEYP_PRESSED_1 "Pressed "
KEYP_UP_2 "Up"
KEYP_THEUPAR_3 "The up arrow was pressed."
KEYP_SHOULDD_4 "Should detect because ignore second issue"
KEYP_THEAKEY_5 "The a key was pressed."

msg parser type

valid msg syntax

Files that use the msg parser are expected to have valid msg syntax

.msg uses the msg parser type

When defining a project containing LRM Standard .msg resource files, there is no need to define a <parser-type> as the msg parser will always be used.

unique file extension needs to define msg parser type

If a unique file extension is a valid .msg file, then the <parser-type> should be msg in the project definition file.

Example of Project Definition for Resources

The following is an example of msg resource file definitions. See resource extensions for more information.

 <resource-extensions>
   <resource-extension>
     <!-- parser-type not needed since .msg is a standard LRM extension that maps to the msg parser type -->
     <extension>msg</extension>
     <file-name-pattern>*_l_c_v</file-name-pattern>
     <use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>
     <file-location-pattern></file-location-pattern>
     <use-location-pattern-on-dflt-locale>0</use-location-pattern-on-dflt-locale>
     <base-file-encoding>UTF-8</base-file-encoding>
     <localized-file-encoding>UTF-8</localized-file-encoding>
     <parameter-regex-pattern><![CDATA[%\\d+%|%[ds]]]></parameter-regex-pattern>
   </resource-extension>
   <resource-extension>
     <!-- parser-type is required because .myext is not a standard LRM extension -->
     <extension>myext</extension>
     <parser-type>msg</parser-type>
     <file-name-pattern>*_l_c_v</file-name-pattern>
     <use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>
     <file-location-pattern></file-location-pattern>
     <use-location-pattern-on-dflt-locale>0</use-location-pattern-on-dflt-locale>
     <base-file-encoding>UTF-8</base-file-encoding>
     <localized-file-encoding>UTF-8</localized-file-encoding>
     <parameter-regex-pattern><![CDATA[%\\d+%|%[ds]]]></parameter-regex-pattern>
   </resource-extension>
 </resource-extensions>