FileAccess Orion

CsvFileLoader extends FileLoader
in package

CsvFileLoader loads translations from CSV files.

Tags
author

Saša Stamenković umpirsky@gmail.com

Table of Contents

$delimiter  : mixed
$enclosure  : mixed
$escape  : mixed
load()  : MessageCatalogue
Loads a locale.
setCsvControl()  : mixed
Sets the delimiter, enclosure, and escape character for CSV.
loadResource()  : array<string|int, mixed>
flatten()  : array<string|int, mixed>
Flattens an nested array of translations.

Properties

Methods

load()

Loads a locale.

public load(mixed $resource, mixed $locale[, mixed $domain = 'messages' ]) : MessageCatalogue
Parameters
$resource : mixed

A resource

$locale : mixed

A locale

$domain : mixed = 'messages'

The domain

Return values
MessageCatalogue

A MessageCatalogue instance

setCsvControl()

Sets the delimiter, enclosure, and escape character for CSV.

public setCsvControl([string $delimiter = ';' ][, string $enclosure = '"' ][, string $escape = '\' ]) : mixed
Parameters
$delimiter : string = ';'

Delimiter character

$enclosure : string = '"'

Enclosure character

$escape : string = '\'

Escape character

Return values
mixed

loadResource()

protected loadResource(mixed $resource) : array<string|int, mixed>
Parameters
$resource : mixed
Return values
array<string|int, mixed>

flatten()

Flattens an nested array of translations.

private flatten(array<string|int, mixed> $messages) : array<string|int, mixed>

The scheme used is: 'key' => ['key2' => ['key3' => 'value']] Becomes: 'key.key2.key3' => 'value'

Parameters
$messages : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results