Difference between revisions of "LRM text Support"

From Lingoport Wiki
Jump to: navigation, search
(Created page with "=== text/txt file extension use the ''text'' parser type=== When defining a project containing LRM Standard .txt or .text resource files, there is no need to define a ''<pa...")
 
(unique file extension needs to define text parser type)
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== text/txt file extension use the ''text'' parser type===
+
== Example of a file extension that uses the ''text'' parser type ==
  +
This is just a file that contains some text
When defining a project containing LRM Standard .txt or .text resource files, there is no need to define a ''&lt;parser-type&gt;'' as the ''text'' parser will always be used.
 
  +
--- and some more text
   
=== unique file extension needs to define ''text'' parser type ===
+
== 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 ''&lt;parser-type&gt;'' 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 ''&lt;parser-type&gt;'' should be ''text'' in the project definition file.
 
If a unique file extension is a valid text file, then the ''&lt;parser-type&gt;'' should be ''text'' in the project definition file.
   
Line 18: Line 22:
 
<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>
'''<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>l_c_v</file-location-pattern>'''
+
<file-location-pattern>l_c_v</file-location-pattern>
'''<use-location-pattern-on-dflt-locale>1</use-location-pattern-on-dflt-locale>'''
+
<use-location-pattern-on-dflt-locale>1</use-location-pattern-on-dflt-locale>
'''<base-file-encoding>UTF-8</base-file-encoding>'''
+
<base-file-encoding>UTF-8</base-file-encoding>
'''<localized-file-encoding>UTF-8</localized-file-encoding>'''
+
<localized-file-encoding>UTF-8</localized-file-encoding>
'''<parameter-regex-pattern></parameter-regex-pattern>'''
+
<parameter-regex-pattern></parameter-regex-pattern>
 
</resource-extension>
 
</resource-extension>
 
<resource-extension>
 
<resource-extension>
Line 42: Line 35:
 
'''<extension>''myext''</extension>'''
 
'''<extension>''myext''</extension>'''
 
'''''<parser-type>text</parser-type>'''''
 
'''''<parser-type>text</parser-type>'''''
'''<file-name-pattern>*-l_c_v</file-name-pattern>'''
+
<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>l_c_v</file-location-pattern>'''
+
<file-location-pattern>l_c_v</file-location-pattern>
'''<use-location-pattern-on-dflt-locale>1</use-location-pattern-on-dflt-locale>'''
+
<use-location-pattern-on-dflt-locale>1</use-location-pattern-on-dflt-locale>
'''<base-file-encoding>UTF-8</base-file-encoding>'''
+
<base-file-encoding>UTF-8</base-file-encoding>
'''<localized-file-encoding>UTF-8</localized-file-encoding>'''
+
<localized-file-encoding>UTF-8</localized-file-encoding>
'''<parameter-regex-pattern></parameter-regex-pattern>'''
+
<parameter-regex-pattern></parameter-regex-pattern>
 
</resource-extension>
 
</resource-extension>
 
</resource-extensions>
 
</resource-extensions>

Revision as of 21:54, 10 December 2018

Example of a file extension that uses the text parser type

This is just a file that contains some text
--- and some more text

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>