About Arbortext Styler > Adding Generated Text > Maintaining Translations of Generated Text > Using ACL to Import XLIFF Files
  
Using ACL to Import XLIFF Files
Arbortext Styler includes an API to automatically import XLIFF files that contain translations of generated text. The API includes the following functions:
stylesheet_import_xlf - imports the XLIFF file and provides some statistics about the import. Specify the XLIFF file to import, the stylesheet it should be associated with, and how questionable translations should be handled during the import.
stylesheet_gentext_lang_stats - provides statistical information about the translation status of the stylesheet. Define the target translation language from the stylesheet for which to provide statistics.
You can use the functions in either of the following ways — note that it is not essential that a user document is opened:
Open a user document that uses the stylesheet and then perform these operations by passing in the user document
Open the stylesheet directly and pass it in
Sample ACL Code Calling stylesheet_import_xlf and stylesheet_gentext_lang_stats
function test(doc_id, xlf_file)
{

local stats[]

local ret = stylesheet_gentext_lang_stats('de', stats, doc);

local total = stats['total'];
local current = stats['current'];
local ecurrent = stats['effectivecurrent'];
local notcurrent = stats['notcurrent'];
local enotcurrent = stats['effectivenotcurrent'];
local untranslated = stats['untranslated'];
local euntranslated = stats['effectiveuntranslated'];

if (ret == 0)
{
response("Call to stylesheet_gentext_lang_stats failed");
}
else
{
response("Stats: total=$total, current=$current($ecurrent), not current=$notcurrent($enotcurrent), untranslated=$untranslated($euntranslated)");
}

# Flags are set to 0, will reject for the 3 documented circumstances.

local stats[]
ret = stylesheet_import_xlf('c:\test.xlf', 0, stats, doc);

local xlfTotal = stats['xlftotal'];
local ssTotal = stats['sstotal'];
local rejected = stats['rejected'];
local updated = stats['updated'];
local found = stats['found'];
local missing = stats['missing'];

if (ret == 0)
{
response("Call to stylesheet_import_xlf failed");
}
else
{
response("Import results: xliff total=$xlfTotal, stylesheet total=$ssTotal, rejected=$rejected, updated=$updated, found=$found, missing=$missing");
}
}