KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Get Indexed String compatible with XLIFF
PRODUCT: 4D | VERSION: 11.3 | PLATFORM: Mac & Win
Published On: March 4, 2009

The Get indexed string command returns a string stored in a string list ("STR#") resource by passing its ID in resID. The syntax follows:

Get indexed string (resID; strID{; resFile}) -> String

It can also return a string from an open XLIFF file by passing the 'id' attribute of the 'group' element in resID. The Get indexed string command looks for values corresponding to resID and strID in all the open XLIFF files when the resFile parameter is omitted.

Furthermore, the resID parameter specifies the id attribute of the group element and the strID parameter specifies the id attribute of the trans-unit element. If the value is not found, the Get indexed string command continues to search in the open resources files.

For example:

A XLIFF file contains the following information:


<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation file.
This file is distributed under the same license as the product package.-->
<!DOCTYPE xliff PUBLIC "-//XLIFF//DTD XLIFF//EN" "https://www.oasis-open.org/committees/xliff/documents/xliff.dtd">
<xliff version="1.0">
<file datatype="x-STR#" original="undefined" source-language="en" target-language="en">
<header>
<prop-group name="Xliff-Editor.4dbase">
<prop prop-type="version">1.0</prop>
</prop-group>
</header>
<body>
<group resname="labels" id="21000">
<trans-unit id="1" resname="Account Management" translate="no">
<source>Account Management</source>
</trans-unit>
<trans-unit id="2" resname="Project Management" translate="no">
<source>Project Management</source>
</trans-unit>
<trans-unit id="3" resname="Financial" translate="no">
<source>Financial</source>
</trans-unit>
<trans-unit id="4" resname="Management" translate="no">
<source>Management</source>
</trans-unit>
<trans-unit id="5" resname="Marketing" translate="no">
<source>Marketing</source>
</trans-unit>
</group>
</body>
</file>
</xliff>



To obtain "Account Management" you can use:

C_TEXT($xliff_t)

$xliff_t:=Get indexed string(21000;1)