LRM rjs Support: Difference between revisions

From Lingoport Wiki
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
rjs is a deprecated format. rjs files are generated by Globalyzer Workbench and this format has been superseded by .json string externalization as a more standardized format for JavaScript.
== Example .rjs File ==
== Example .rjs File ==
<pre>
<pre>
Line 12: Line 14:
</pre>
</pre>


== Example Project Definition File ==
== ''js'' parser type ==
=== valid rjs syntax ===
Files that use the ''js'' parser are expected to have valid rjs syntax as defined [[LRM_rjs_Support#Example_.rjs_File|above]].
 
=== .rjs uses the ''js'' parser type===
When defining a project containing LRM Standard '''.rjs''' extension resource files, there is no need to define a ''&lt;parser-type&gt;'' as the ''js'' parser will always be used.
 
=== unique file extension needs to define ''js'' parser type ===
If a unique file extension is a valid .js file, then the ''&lt;parser-type&gt;'' should be ''js'' in the project definition file.
 
== Example of Project Definition for Resources ==
The following is an example of js resource file definitions. See [[Supported_Resource_Bundles#Resource_Extensions| resource extensions]] for more information.


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <resource-extensions>
<lrmconf>
    <resource-extension>
  <model-version>2.0.11</model-version>
      '''&lt;!-- parser-type not needed since .rjs is a standard LRM extension that maps to the ''js'' parser type --&gt;'''
  <project-name>DemoRjs</project-name>
      '''<extension>rjs</extension>'''
  <project-desc>This is a sample LRM Project definition file, configured for Globalyzer RJS files</project-desc>
      '''<file-name-pattern>*-l_c_v</file-name-pattern>'''
  <group-name>acme</group-name>
      '''<use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>'''
  <top-level-dir>C:\acme\source</top-level-dir>
      '''<file-location-pattern/>'''
  <detect-errors>
      '''<use-location-pattern-on-dflt-locale>0</use-location-pattern-on-dflt-locale>'''
    <missed-trans-error>1</missed-trans-error>
      '''<base-file-encoding>UTF-8</base-file-encoding>'''
    <parameter-mismatch-error>1</parameter-mismatch-error>
      '''<localized-file-encoding>UTF-8</localized-file-encoding>'''
  </detect-errors>
      '''<parameter-regex-pattern><![CDATA[\{\d+\}|%[ds]]]></parameter-regex-pattern>'''
  <track-back-locale>br</track-back-locale>
    </resource-extension>
  <pseudo-locale>eo</pseudo-locale>
  <target-locales>
    <locale>es_MX</locale>
    <locale>fr_CA</locale>
    <locale>fr_FR</locale>
  </target-locales>
  <default-locale>en_US</default-locale>
  <resource-extensions>
     <resource-extension>
     <resource-extension>
       <extension>rjs</extension>
       '''''&lt;!-- parser-type is required because .myext is not a standard LRM extension &gt;'''''
       <file-name-pattern>*-l_c_v</file-name-pattern>
      '''<extension>''myext''</extension>'''
       <use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>
      '''''<parser-type>js</parser-type>'''''
       <file-location-pattern/>
       '''<file-name-pattern>*-l_c_v</file-name-pattern>'''
       <use-location-pattern-on-dflt-locale>0</use-location-pattern-on-dflt-locale>
       '''<use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>'''
       <base-file-encoding>UTF-8</base-file-encoding>
       '''<file-location-pattern/>'''
       <localized-file-encoding>UTF-8</localized-file-encoding>
       '''<use-location-pattern-on-dflt-locale>0</use-location-pattern-on-dflt-locale>'''
       <parameter-regex-pattern><![CDATA[\{\d+\}|%[ds]]]></parameter-regex-pattern>
       '''<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>
   </resource-extensions>
   </resource-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:59, 7 January 2019

rjs is a deprecated format. rjs files are generated by Globalyzer Workbench and this format has been superseded by .json string externalization as a more standardized format for JavaScript.

Example .rjs File

// SOURCE_FILE C:/Users/rdaly/Desktop/2016/SmokeTestSource/javascript/FilterPatternOrderTests.js
var FILT_DDMMYYY_7="dd/MM/yyyy";
var FILT_CHCHCHC_8="chchchc";
var FILT_CHCHCHC_9="chchchc";

// SOURCE_FILE C:/Users/rdaly/Desktop/2016/SmokeTestSource/javascript/methods/javascriptmethods.jsp
var JAVA_INSETCM_10="In SetCmd - value = ";
var JAVA_YOUHAVE_11="You have made some changes on this page.  Do you want to continue without saving the changes?";
var JAVA_ENTERAN_12="Enter an evaluation name.\n";

js parser type

valid rjs syntax

Files that use the js parser are expected to have valid rjs syntax as defined above.

.rjs uses the js parser type

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

unique file extension needs to define js parser type

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

Example of Project Definition for Resources

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

  <resource-extensions>
   <resource-extension>
     <!-- parser-type not needed since .rjs is a standard LRM extension that maps to the js parser type -->
     <extension>rjs</extension>
     <file-name-pattern>*-l_c_v</file-name-pattern>
     <use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>
     <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>js</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/>
     <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>