Difference between revisions of "Supported Resource Bundles"

From Lingoport Wiki
Jump to: navigation, search
(What resource file types are supported by LRM?)
Line 1: Line 1:
 
== What resource file types are supported by LRM?==
 
== What resource file types are supported by LRM?==
  +
=== Standard LRM extensions ===
The Lingoport Resource Manager supports the following file types:
 
 
<ul>
 
<ul>
<li><b>[[LRM html Support | .htm and .html]]</b> files</li>
+
<li><b>[[LRM html Support | .htm and .html]]</b> files using the [[LRM_html_Support#html_parser_type | ''html'']] parser</li>
<li><b>[[LRM JSON Support | .json]]</b> (Mostly JavaScript, and other programming languages)</li>
+
<li><b>[[LRM JSON Support | .json]]</b> (Mostly JavaScript, and other programming languages) using the [[LRM_JSON_Support#json_parser_type | ''json'']] parser</li>
<li><b>[[LRM msg Support|.msg]]</b> (C, C++, ...)</li>
+
<li><b>[[LRM msg Support|.msg]]</b> (C, C++, ...) using the [[LRM_msg_Support#msg_parser_type|''msg'']] parser</li>
<li><b>[[LRM po Support|.po]]</b> files </li>
+
<li><b>[[LRM po Support|.po]]</b> files using the [[LRM_po_Support#po_parser_type|''po'']] parser</li>
<li> <b>[[ LRM Properties Support| .properties]]</b> files (Java-type resources) </li>
+
<li> <b>[[ LRM Properties Support| .properties]]</b> files (Java-type resources) using [[LRM_Properties_Support#properties_parser_type|''properties'']] parser</li>
<li><b>[[ LRM resx Support| .resx]]</b> files (used in the .Net world)</li>
+
<li><b>[[ LRM resx Support| .resx]]</b> files (used in the .Net world) using [[LRM_resx_Support#xml_parser_type_using_ResxParser.xml_format_definition|''xml'']] parser and the ResxParser.xml format definition</li>
<li><b>[[LRM rc Support|.rc]]</b> (Delphi, ...)</li>
+
<li><b>[[LRM rc Support|.rc]]</b> (Delphi, ...) using the [[LRM_rc_Support#rc_parser_type|''rc'']] parser</li>
<li><b>[[LRM rjs Support|.rjs]]</b> (for JavaScript)</li>
+
<li><b>[[LRM rjs Support|.rjs]]</b> (for JavaScript) using the [[LRM_rjs_Support#js_parser_type|''js'']] parser</li>
<li> <b>[[LRM rxml Support|.rxml]]</b> (for xml)</li>
+
<li> <b>[[LRM rxml Support|.rxml]]</b> using the [[LRM_rxml_Support#xml_parser_type_using_RxmlParser.xml_format_definition|''xml'']] parser and the RxmlParser.xml format definition)</li>
<li><b>[[LRM strings Support|.strings]]</b> (Mobile iOS)</li>
+
<li><b>[[LRM strings Support|.strings]]</b> (Mobile iOS) using the ''strings'' parser</li>
<li><b>[[LRM Android Support | strings.xml]]</b> (Android)</li>
+
<li><b>[[LRM Android Support | strings.xml]]</b> (Android) using the [[LRM_Android_Support#xml_parser_type_using_AndroidParser.xml_format_definition|''xml'']] parser and the AndroidParser.xml format definition</li>
  +
</ul>
  +
=== Unique Extensions ===
  +
Any file extension can be handled by LRM as long as the corresponding parser type is defined. The file must be able to be parsed correctly by the defined parser type or an error will occur. The parser types are:
  +
<ul>
  +
<li><b>[[LRM_html_Support#html_parser_type | ''html'']]</b> parser</li>
  +
<li><b>[[LRM_JSON_Support#json_parser_type | ''json'']]</b> parser </li>
  +
<li><b>[[LRM_msg_Support#msg_parser_type|''msg'']]</b> parser</li>
  +
<li><b>[[LRM_po_Support#po_parser_type|''po'']]</b> parser</li>
  +
<li><b>[[LRM_Properties_Support#properties_parser_type|''properties'']]</b> parser</li>
  +
<li><b>[[LRM_rc_Support#rc_parser_type|''rc'']]</b> parser</li>
  +
<li><b>[[LRM_rjs_Support#js_parser_type|''js'']]</b> parser</li>
  +
<li><b>xml</b> parser</li>
 
</ul>
 
</ul>
   
Line 83: Line 95:
 
</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>
 
</lrmconf>
 
</pre>
 
</pre>

Revision as of 16:36, 1 September 2017

What resource file types are supported by LRM?

Standard LRM extensions

  • .htm and .html files using the html parser
  • .json (Mostly JavaScript, and other programming languages) using the json parser
  • .msg (C, C++, ...) using the msg parser
  • .po files using the po parser
  • .properties files (Java-type resources) using properties parser
  • .resx files (used in the .Net world) using xml parser and the ResxParser.xml format definition
  • .rc (Delphi, ...) using the rc parser
  • .rjs (for JavaScript) using the js parser
  • .rxml using the xml parser and the RxmlParser.xml format definition)
  • .strings (Mobile iOS) using the strings parser
  • strings.xml (Android) using the xml parser and the AndroidParser.xml format definition

Unique Extensions

Any file extension can be handled by LRM as long as the corresponding parser type is defined. The file must be able to be parsed correctly by the defined parser type or an error will occur. The parser types are:

Lingoport Resource Manager Configuration

LRM creates projects using a Project Definition XML file that contains information about the resources and types for translation. Here is a typical .xml definition for projects with .properties files.

This will create a project called com.company.project in the group SVNFTP. The resource files are located in the /var/lib/jenkins/jobs/SVNFTP.com.company.project/workspace directory. The resources are targeting six different locales. The resource files to be translated are .properties files.

This is the LRM project name that will be created. LRM will create a project called com.company.project

<project-name>com.company.project</project-name>

This is the LRM group name that the project will be under.

<group-name>SVNFTP</group-name>

This is the location of the resource files for source code associated with the com.company.project LRM project.

<top-level-dir>/var/lib/jenkins/jobs/SVNFTP.com.company.project/workspace</top-level-dir>

This is the locale to translate from

<default-locale>en_US</default-locale>

Here are the locales which will be translated into

 <target-locales>
   <locale>fr</locale>
   <locale>de_DE</locale>
   <locale>slv</locale>
   <locale>nob_NO_UNI</locale>
   <locale>zh_Hant</locale>
   <locale>ZHT_Hans</locale>
 </target-locales>

This tells LRM to look for .properties resource files.

<extension>properties</extension>

Here is a sample Project Definition file to create an LRM project. This example is for .properties files. Additional <resource-extension> stanzas can be added to include other extensions. Samples for the supported extensions can be found in <HOME>/lingoport/lrm-server-x.y/samples.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<lrmconf>
  <model-version>2.0.12</model-version>
  <project-name>com.company.project</project-name>
  <project-desc>This is a sample LRM Project definition file, configured to support Java properties files</project-desc>
  <!--group-name contains the group name that the LRM license is under-->
  <group-name>SVNFTP</group-name>
  <top-level-dir>/var/lib/jenkins/jobs/SVNFTP.com.company.project/workspace</top-level-dir>
  <detect-errors>
    <!--If set to '0' (false), then the 'missed translation' error will not be triggered-->
    <missed-trans-error>0</missed-trans-error>
    <parameter-mismatch-error>1</parameter-mismatch-error>
  </detect-errors>
  <pseudo-locale>eo</pseudo-locale>
  <default-locale>en_US</default-locale>
  <target-locales>
    <locale>fr</locale>
    <locale>de_DE</locale>
    <locale>slv</locale>
    <locale>nob_NO_UNI</locale>
    <locale>zh_Hant</locale>
    <locale>ZHT_Hans</locale>
  </target-locales>
    <resource-extension>
      <extension>properties</extension>
      <file-name-pattern>*_l_c_v</file-name-pattern>
      <!--If the base resource files use the file-name-pattern in their name -->
      <!--then set use-pattern-on-dflt-locale to 1, if not then set to 0-->
      <use-pattern-on-dflt-locale>1</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>
      <!--Default pattern for properties is '![CDATA[\{\d+\}|%[ds]]]'-->
      <parameter-regex-pattern><![CDATA[\{\w+\}|%[ds]]]></parameter-regex-pattern>
    </resource-extension>
  </resource-extensions>
</lrmconf>