Documentation

Xml
in package

I18n XML format class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.2.0

Table of Contents

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
throws
Exception
Return values
void

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 $dir = null ]) : void
Parameters
$source : string
$output : string
$dir : string = null
Tags
throws
Exception
Return values
void

Search results