\TransvisionPo

Po class

This class is used to manipulate translation files in Gettext (.po) 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  $po_path, string  $project_name, boolean  $template = false) : array

Loads strings from a .po file

Parameters

string $po_path

Path to the .po to load

string $project_name

The project this string belongs to

boolean $template

If I'm looking at templates

Returns

array —

Array of strings as [string_id => translation]

generateStringID()

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

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

Parameters

string $project_name

The project this string belongs to

string $file_name

.po file name

string $string_id

String ID (context-original text)

Returns

string —

unique ID such as focus_android/app.po:1dafea7725862ca854c408f0e2df9c88