Difference between revisions of "LRM rc Support"

From Lingoport Wiki
Jump to: navigation, search
(Example Project Definition File)
(valid rc syntax)
 
(One intermediate revision by the same user not shown)
Line 90: Line 90:
 
== ''rc'' parser type ==
 
== ''rc'' parser type ==
 
=== valid rc syntax ===
 
=== valid rc syntax ===
Files that use the ''rc'' parser are expected to have valid rc syntax
+
Files that use the ''rc'' parser are expected to have valid rc syntax.
  +
Key and corresponding value must be on the same line.
   
 
=== .rc uses the ''rc'' parser type===
 
=== .rc uses the ''rc'' parser type===
Line 97: Line 98:
 
If a unique file extension is a valid .rc file, then the ''<parser-type>'' should be ''rc'' in the project definition file.
 
If a unique file extension is a valid .rc file, then the ''<parser-type>'' should be ''rc'' in the project definition file.
   
== Example Project Definition File ==
+
== Example of Project Definition for Resources ==
  +
The following is an example of rc resource file definitions. See [[Supported_Resource_Bundles#Resource_Extensions| resource extensions]] for more information.
<?xml version="1.0" encoding="UTF-8"?>
 
  +
<lrmconf>
 
<model-version>2.0.11</model-version>
 
<group-name>acme</group-name>
 
<project-name>DemoRc</project-name>
 
<project-desc>This is a sample LRM Project definition file, configured to support RC properties files</project-desc>
 
<top-level-dir>C:\acme\source</top-level-dir>
 
<detect-errors>
 
<missed-trans-error>0</missed-trans-error>
 
<parameter-mismatch-error>1</parameter-mismatch-error>
 
</detect-errors>
 
<track-back-locale>br</track-back-locale>
 
<pseudo-locale>eo</pseudo-locale>
 
<target-locales>
 
<locale>fr_FR</locale>
 
<locale>fr_CA</locale>
 
<locale>es_MX</locale>
 
</target-locales>
 
<default-locale>en_US</default-locale>
 
 
<resources-extensions>
 
<resources-extensions>
 
<resource-extension>
 
<resource-extension>
Line 142: Line 126:
 
</resource-extension>
 
</resource-extension>
 
</resources-extensions>
 
</resources-extensions>
<dirset>
 
<includes>
 
<include-dir-file>**/src/**</include-dir-file>
 
</includes>
 
<excludes>
 
<exclude-dir-file>**/src/test/**</exclude-dir-file>
 
</excludes>
 
</dirset>
 
</lrmconf>
 

Latest revision as of 16:33, 30 January 2018

Example .rc file or a file extension that uses the rc parser type

// Microsoft Visual C++ generated resource script.
//
#include "Smoke.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS


#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1252)

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

/////////////////////////////////////////////////////////////////////////////
// Default Locale Resources



// SHARED_ENTRIES
STRINGTABLE
BEGIN
    FILT_TRUE_5    "true"
END
// END_SHARED_ENTRIES

// SOURCE_FILE C:/Path/to/my/source/file/FilterPatternOrderTests.js
STRINGTABLE
BEGIN
    FILT_TRUE_4    "true"
    FILT_DDMMYYY_6    "dd/MM/yyyy"
END

// SOURCE_FILE C:/Path/to/my/source/file/example-source-javascript/strings.js
STRINGTABLE
BEGIN
    STRI_ANDTHIS_1    "&and this "
    STRI_ISHOULD_2    "I should be detected because not in ignore next line comment"
    STRI_ISHOULD_3    "I should be detected because outside ignore start/end block"
END

rc parser type

valid rc syntax

Files that use the rc parser are expected to have valid rc syntax. Key and corresponding value must be on the same line.

.rc uses the rc parser type

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

unique file extension needs to define rc parser type

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

Example of Project Definition for Resources

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

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