Difference between revisions of "Supported Resource Bundles"

From Lingoport Wiki
Jump to: navigation, search
(.properties)
Line 3: Line 3:
 
For more information, please refer to : http://en.wikipedia.org/wiki/.properties
 
For more information, please refer to : http://en.wikipedia.org/wiki/.properties
 
=== Resource Manager Configuration ===
 
=== Resource Manager Configuration ===
<TODO> Typical .xml definition for projects with .properties files.
+
Typical .xml definition for projects with .properties files.
  +
  +
<pre?
  +
<?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 either the company name or the group name-->
  +
<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>
  +
<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>
  +
</pre>

Revision as of 16:28, 27 April 2015

.properties

The encoding of a .properties file is ISO-8859-1, also known as Latin-1. All non-Latin-1 characters must be entered by using Unicode escape characters, e. g. \uHHHH where HHHH is a hexadecimal index of the character in the Unicode character set. This allows for using .properties files as resource bundles for localization. A non-Latin-1 text file can be converted to a correct .properties file by using the native2ascii tool that is shipped with the JDK or by using a tool, such as po2prop, that manages the transformation from a bilingual localization format into .properties escaping. For more information, please refer to : http://en.wikipedia.org/wiki/.properties

Resource Manager Configuration

Typical .xml definition for projects with .properties files.

<pre? <?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>SVNFTP</group-name>
 <top-level-dir>/var/lib/jenkins/jobs/SVNFTP.com.company.project/workspace</top-level-dir>
 <detect-errors>
   <missed-trans-error>0</missed-trans-error>
   <parameter-mismatch-error>1</parameter-mismatch-error>
 </detect-errors>
 <pseudo-locale>eo</pseudo-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>
     <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>
     <parameter-regex-pattern><![CDATA[\{\w+\}|%[ds]]]></parameter-regex-pattern>
   </resource-extension>
 </resource-extensions>

</lrmconf>