\TransvisionXliff

Xliff class

This class is used to manipulate translation files in XLIFF format.

Summary

Methods
Properties
Constants
getStrings()
generateStringID()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getStrings()

getStrings(string  $xliff_path, string  $project_name) : array

Loads strings from a .xliff file

Parameters

string $xliff_path

Path to the .xliff to load

string $project_name

The project this string belongs to

Returns

array —

Array of strings as [string_id => translation]

generateStringID()

generateStringID(string  $project_name, string  $file_name, string  $file_orig, string  $string_id) : string

Generate a unique ID for a string to store in Transvision.

String ID can be identical to the source string in iOS, so it's more reliable to generate a unique ID from it.

Parameters

string $project_name

The project this string belongs to

string $file_name

.xliff file name

string $file_orig

'original' attribute of the element's parent

string $string_id

'id' attribute of the element

Returns

string —

unique ID such as firefox_ios/firefox-ios.xliff:1dafea7725862ca854c408f0e2df9c88