Difference between revisions of "LRM text Support"

From Lingoport Wiki
Jump to: navigation, search
(text/txt file extension use the text parser type)
(Example of Project Definition for Resources)
Line 18: Line 18:
 
<resource-extension>
 
<resource-extension>
 
'''&lt;!-- parser-type not needed since .text is a standard LRM extension that maps to the ''text'' parser type --&gt;'''
 
'''&lt;!-- parser-type not needed since .text is a standard LRM extension that maps to the ''text'' parser type --&gt;'''
'''<extension>text</extension>'''
 
<file-name-pattern>*-l_c_v</file-name-pattern>
 
<use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>
 
<file-location-pattern>l_c_v</file-location-pattern>
 
<use-location-pattern-on-dflt-locale>1</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></parameter-regex-pattern>
 
</resource-extension>
 
<resource-extension>
 
'''&lt;!-- parser-type not needed since .txt is a standard LRM extension that maps to the ''text'' parser type --&gt;'''
 
 
'''<extension>txt</extension>'''
 
'''<extension>txt</extension>'''
 
<file-name-pattern>*-l_c_v</file-name-pattern>
 
<file-name-pattern>*-l_c_v</file-name-pattern>

Revision as of 23:26, 27 November 2018

txt file extension use the text parser type

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

unique file extension needs to define text parser type

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

LRM interaction with text parser type files

Number of keys in file is 1

All files that are parsed using the text parser have only 1 key called key1. The value that corresponds to this key is the entire text file.

Prep kit files are always full file

If the checksum of the base file has changed then the file will be sent out in the next prep kit for all target locales. Since the file contains only 1 key, the entire file will be sent out for translation.

Example of Project Definition for Resources

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

  <resource-extensions>
   <resource-extension>
     <!-- parser-type not needed since .text is a standard LRM extension that maps to the text parser type -->
     <extension>txt</extension>
     <file-name-pattern>*-l_c_v</file-name-pattern>
     <use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>
     <file-location-pattern>l_c_v</file-location-pattern>
     <use-location-pattern-on-dflt-locale>1</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></parameter-regex-pattern>
   </resource-extension>
   <resource-extension>
     <!-- parser-type is required because .myext is not a standard LRM extension -->
     <extension>myext</extension>
     <parser-type>text</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>l_c_v</file-location-pattern>
     <use-location-pattern-on-dflt-locale>1</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></parameter-regex-pattern>
   </resource-extension>
 </resource-extensions>