Difference between revisions of "LRM rjs Support"
(→Example .rjs File) |
|||
(9 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> |
||
− | == |
+ | == ''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=== |
||
− | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||
+ | 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. |
||
− | <lrmconf> |
||
+ | |||
− | <model-version>2.0.11</model-version> |
||
+ | === unique file extension needs to define ''js'' parser type === |
||
− | <project-name>DemoRjs</project-name> |
||
+ | If a unique file extension is a valid .js file, then the ''<parser-type>'' should be ''js'' in the project definition file. |
||
− | <project-desc>This is a sample LRM Project definition file, configured for Globalyzer RJS files</project-desc> |
||
+ | |||
− | <!--group-name contains either the company name or the group name. --> |
||
+ | == Example of Project Definition for Resources == |
||
− | <group-name>acme</group-name> |
||
+ | The following is an example of js resource file definitions. See [[Supported_Resource_Bundles#Resource_Extensions| resource extensions]] for more information. |
||
− | <!-- Example, linux --> |
||
+ | |||
− | <!--<top-level-dir>/var/lib/job/workspace/acme/source</top-level-dir>--> |
||
+ | <resource-extensions> |
||
− | <top-level-dir>C:\acme\source</top-level-dir> |
||
− | < |
+ | <resource-extension> |
+ | '''<!-- parser-type not needed since .rjs is a standard LRM extension that maps to the ''js'' parser type -->''' |
||
− | <!--If set to '0' (false), then the 'missed translation' error will not be triggered--> |
||
+ | '''<extension>rjs</extension>''' |
||
− | <!--if the non-base file has the same text as the base file.--> |
||
+ | '''<file-name-pattern>*-l_c_v</file-name-pattern>''' |
||
− | <!--Missed Translation error will still occur if the base file has a different key or if--> |
||
+ | '''<use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>''' |
||
− | <!--the base file has changed since it was last prepped.--> |
||
+ | '''<file-location-pattern/>''' |
||
− | <missed-trans-error>1</missed-trans-error> |
||
+ | '''<use-location-pattern-on-dflt-locale>0</use-location-pattern-on-dflt-locale>''' |
||
− | <parameter-mismatch-error>1</parameter-mismatch-error> |
||
+ | '''<base-file-encoding>UTF-8</base-file-encoding>''' |
||
− | </detect-errors> |
||
+ | '''<localized-file-encoding>UTF-8</localized-file-encoding>''' |
||
− | <!--If you wish to create Track Back resource files, enter the Track Back locale such as `br`--> |
||
+ | '''<parameter-regex-pattern><![CDATA[\{\d+\}|%[ds]]]></parameter-regex-pattern>''' |
||
− | <!--The track back locale is mutually exclusive of the base (default) locale, target locales and pseudo-locale--> |
||
+ | </resource-extension> |
||
− | <track-back-locale>br</track-back-locale> |
||
− | <!--If you wish to pseudo-localized your files enter a pseudo-locale--> |
||
− | <!--The pseudo-locale is mutually exclusive of the base (default) locale and target locales--> |
||
− | <pseudo-locale>eo</pseudo-locale> |
||
− | <!--Target locales are the locales where the corresponding resource files will be translated. --> |
||
− | <!--These target locales are mutually exclusive of the base (default) locale--> |
||
− | <target-locales> |
||
− | <locale>es_MX</locale> |
||
− | <locale>fr_CA</locale> |
||
− | <locale>fr_FR</locale> |
||
− | </target-locales> |
||
− | <!--Default locale is the base locale. This is the locale where corresponding resource files will not be translated.--> |
||
− | <!--The base (default) locale is mutually exclusive of the target locales--> |
||
− | <default-locale>en_US</default-locale> |
||
− | <resource-extensions> |
||
− | <!--The file-name-pattern and/or file-location-pattern indicate the pattern of the--> |
||
− | <!--localized file names (file-name-pattern) and the localized folder names (file-location-pattern).--> |
||
− | <!--If the names contain the locale then a pattern of 1,c and v will be used.--> |
||
− | <!--If the names contain the Locale ID then LCID will be used.--> |
||
− | <!--Example pattern using locale--> |
||
− | <!-- If your localized resource files use their locale in their names then the locale pattern will--> |
||
− | <!-- be used where l stands for language; c for country; v for variant; and the characters between--> |
||
− | <!-- are used as the separator characters.--> |
||
− | <!-- <file-name-pattern>*_l_c_v</file-name-pattern>--> |
||
− | <!--Example pattern using LCID (locale ID)--> |
||
− | <!-- If your resource files are under a folder named 'resources' with an LCID suffix separated by an--> |
||
− | <!-- underscore, then the pattern would be:--> |
||
− | <!-- <file-location-pattern>resources_LCID</file-location-pattern>--> |
||
<resource-extension> |
<resource-extension> |
||
+ | '''''<!-- parser-type is required because .myext is not a standard LRM extension >''''' |
||
− | <extension>rjs</extension> |
||
+ | '''<extension>''myext''</extension>''' |
||
− | <file-name-pattern>*-l_c_v</file-name-pattern> |
||
+ | '''''<parser-type>js</parser-type>''''' |
||
− | <!--If the base resource files use the file-name-pattern in their name --> |
||
− | < |
+ | '''<file-name-pattern>*-l_c_v</file-name-pattern>''' |
− | <use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale> |
+ | '''<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>''' |
||
− | <!--then set use-location-pattern-on-dflt-locale to 1, if not then set to 0--> |
||
+ | '''<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> |
||
− | <!--Default pattern for rjs is '![CDATA[\{\d+\}|%[ds]]]'--> |
||
− | <parameter-regex-pattern><![CDATA[\{\d+\}|%[ds]]]></parameter-regex-pattern> |
||
</resource-extension> |
</resource-extension> |
||
</resource-extensions> |
</resource-extensions> |
||
− | <dirset> |
||
− | <!--Define the search patterns to include and/or exclude. (Uses Apache Ant pattern search).--> |
||
− | <!--Examples: --> |
||
− | <!-- A. '**/*.properties' matches all .properties files/dirs in a directory tree.--> |
||
− | <!-- B. 'test/a??.resx' matches all files/dirs which start with an 'a', --> |
||
− | <!-- then two more characters and then '.resx', in a directory called test.--> |
||
− | <!-- C. '**' matches everything in a directory tree. --> |
||
− | <!-- D. '**/source/**/XYZ*' matches all files/dirs which start with 'XYZ'--> |
||
− | <!-- and where there is a parent directory called source (e.g. 'abc/source/def/ghi/XYZ123'). --> |
||
− | <includes> |
||
− | <!--Directories to include in the search for base resource files --> |
||
− | <!--Examples: --> |
||
− | <!-- <include-dir>**/source/**</include-dir>--> |
||
− | <include-dir>**/**</include-dir> |
||
− | </includes> |
||
− | <excludes> |
||
− | <!--Directories or files to exclude in the search --> |
||
− | <!--Examples: --> |
||
− | <!-- <exclude-dir-file>**/source/bin/**</exclude-dir-file> --> |
||
− | <!-- <exclude-dir-file>**/fileToIgnore.*</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.
Contents
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>