Documentation

language
in package

FanPress CM Language handler

Tags
author

Stefan Seehafer sea75300@yahoo.de

copyright

(c) 2011-2020, Stefan Seehafer

license

http://www.gnu.org/licenses/gpl.txt GPLv3

Table of Contents

LANGCODE_VALIDATION  = '/[^a-zA-Z0-9\\-]/'
VARTEXT_NEWLINE  = '[NL]'
FILENAME_LISTS  = 'lists'
FILENAME_VARS  = 'vars'
$cache  : cache
Sprach-Cache
$helpFile  : string
Pfad zu Hilfe-Datei
$langCode  : string
Language code
$langList  : array<string|int, mixed>
Languages list
$langPath  : string
Pfad für Sprachpaket
__construct()  : bool
Konstruktor
getAll()  : array<string|int, mixed>
Returns full language data
getDays()  : array<string|int, mixed>
Gibt sprachspezifische Tage zurück
getDaysShort()  : array<string|int, mixed>
Gibt sprachspezifische Tage zurück
getHelp()  : string
Gibt Hilfe-XML-String zurück
getLangCode()  : string
Gibt aktuellen Sprachcode zurück
getLanguages()  : array<string|int, mixed>
Gibt installierte Sprachpakete zurück
getMonths()  : array<string|int, mixed>
Gibt sprachspezifische Monate zurück
saveFiles()  : bool
Save language vars to corresponding files
translate()  : string
Gibt Text für übergebene Sprachavriable zurück
write()  : mixed
Schreibt Text für übergebene Sprachavriable an die Stelle des Aufrufs, sbwp. in einer View
writeMonth()  : type
Ersetzt Monat (1-12) in sprachspezifischen String
addModulePrefix()  : mixed
Add module prefix to language vars
getFileName()  : string|null
Get language file name and path
getModuleLanguage()  : void
fetch module language files
init()  : bool
Load language variables
loadDataFromSystem()  : void
Load language data from file
writeNewFile()  : bool
Write file content

Constants

LANGCODE_VALIDATION

public mixed LANGCODE_VALIDATION = '/[^a-zA-Z0-9\\-]/'

VARTEXT_NEWLINE

public mixed VARTEXT_NEWLINE = '[NL]'

FILENAME_LISTS

private mixed FILENAME_LISTS = 'lists'

FILENAME_VARS

private mixed FILENAME_VARS = 'vars'

Properties

$helpFile

Pfad zu Hilfe-Datei

private string $helpFile = ''

$langCode

Language code

private string $langCode = ''

$langList

Languages list

private array<string|int, mixed> $langList = []

$langPath

Pfad für Sprachpaket

private string $langPath = ''

Methods

__construct()

Konstruktor

public __construct([string $langCode = '' ]) : bool
Parameters
$langCode : string = ''
Return values
bool

getAll()

Returns full language data

public getAll([bool $force = false ]) : array<string|int, mixed>
Parameters
$force : bool = false
Tags
since
4.4
Return values
array<string|int, mixed>

getDays()

Gibt sprachspezifische Tage zurück

public getDays() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDaysShort()

Gibt sprachspezifische Tage zurück

public getDaysShort() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHelp()

Gibt Hilfe-XML-String zurück

public getHelp() : string
Return values
string

getLangCode()

Gibt aktuellen Sprachcode zurück

public getLangCode() : string
Return values
string

getLanguages()

Gibt installierte Sprachpakete zurück

public getLanguages() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMonths()

Gibt sprachspezifische Monate zurück

public getMonths() : array<string|int, mixed>
Return values
array<string|int, mixed>

saveFiles()

Save language vars to corresponding files

public saveFiles(array<string|int, mixed> $vars, array<string|int, mixed> $lists) : bool
Parameters
$vars : array<string|int, mixed>
$lists : array<string|int, mixed>
Tags
since
4.5
Return values
bool

translate()

Gibt Text für übergebene Sprachavriable zurück

public translate(string $langvar[, array<string|int, mixed> $replaceParams = [] ]) : string
Parameters
$langvar : string

Sprachvariable

$replaceParams : array<string|int, mixed> = []

Liste von Platzhaltern in der Sprachvariable mit zu ersetzendem Text

  • Aufbau: Key = Platzhalter => Value = Text
Return values
string

write()

Schreibt Text für übergebene Sprachavriable an die Stelle des Aufrufs, sbwp. in einer View

public write(string $langvar[, array<string|int, mixed> $replaceParams = [] ]) : mixed
Parameters
$langvar : string

Sprachvariable

$replaceParams : array<string|int, mixed> = []

Liste von Platzhaltern in der Sprachvariable mit zu ersetzendem Text

  • Aufbau: Key = Platzhalter => Value = Text
Return values
mixed

writeMonth()

Ersetzt Monat (1-12) in sprachspezifischen String

public writeMonth(int $monthId[, bool $return = false ]) : type
Parameters
$monthId : int
$return : bool = false
Return values
type

addModulePrefix()

Add module prefix to language vars

private addModulePrefix(string &$val, string $key, array<string|int, mixed> $args) : mixed
Parameters
$val : string
$key : string
$args : array<string|int, mixed>
Return values
mixed

getFileName()

Get language file name and path

private getFileName(string $name) : string|null
Parameters
$name : string
Tags
since
4.5
Return values
string|null

getModuleLanguage()

fetch module language files

private getModuleLanguage() : void
Return values
void

init()

Load language variables

private init() : bool
Tags
since
4.5
Return values
bool

loadDataFromSystem()

Load language data from file

private loadDataFromSystem(string $name) : void
Parameters
$name : string
Tags
since
4.5
Return values
void

writeNewFile()

Write file content

private writeNewFile(string $file, string $content) : bool
Parameters
$file : string
$content : string
Tags
since
4.5
Return values
bool

Search results