\Pop\I18n\FormatXml

I18n XML format class

Summary

Methods
Properties
Constants
createFile()
createFragment()
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

createFile()

createFile(array  $lang, array  $locales, string  $file) : void

Create an XML language file from an array of data.

The format of the parameters should be as follows:

$lang = [ 'src' => 'en', 'output' => 'de', 'name' => 'German', 'native' => 'Deutsch' ];

$locales = [ [ 'region' => 'DE', 'name' => 'Germany', 'native' => 'Deutschland', 'text' => [ [ 'source' => 'This field is required.', 'output' => 'Dieses Feld ist erforderlich.' ], ... ] ], ... ];

Parameters

array $lang
array $locales
string $file

Throws

\Pop\I18n\Format\Exception

createFragment()

createFragment(string  $source, string  $output, string  $dir = null) : void

Create an language file fragment from a source file and an output file, each entry separated by a new line

Parameters

string $source
string $output
string $dir

Throws

\Pop\I18n\Format\Exception