Xml
in package
I18n XML format class
Tags
Table of Contents
Methods
- createFile() : void
- Create an XML language file from an array of data.
- createFragment() : void
- Create an language file fragment from a source file and an output file, each entry separated by a new line
Methods
createFile()
Create an XML language file from an array of data.
public
static createFile(array<string|int, mixed> $lang, array<string|int, mixed> $locales, string $file) : void
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
- $lang : array<string|int, mixed>
- $locales : array<string|int, mixed>
- $file : string
Tags
createFragment()
Create an language file fragment from a source file and an output file, each entry separated by a new line
public
static createFragment(string $source, string $output[, string|null $dir = null ]) : void
Parameters
- $source : string
- $output : string
- $dir : string|null = null