language
in
FanPress CM Language handler
Table of Contents
FILENAME_VARS | 'vars' | |
---|---|---|
FILENAME_LISTS | 'lists' | |
VARTEXT_NEWLINE | '[NL]' | |
$langList | Languages list | array |
$langCode | Language code | string |
$langPath | Pfad für Sprachpaket | string |
$helpFile | Pfad zu Hilfe-Datei | string |
$cache | Sprach-Cache | cache |
__construct() | Konstruktor | bool |
init() | Load language variables | bool |
getFileName() | Get language file name and path | string|null |
loadDataFromSystem() | Load language data from file | void |
getModuleLanguage() | fetch module language files | void |
addModulePrefix() | Add module prefix to language vars | mixed |
getLanguages() | Gibt installierte Sprachpakete zurück | array |
getLangCode() | Gibt aktuellen Sprachcode zurück | string |
getHelp() | Gibt Hilfe-XML-String zurück | string |
translate() | Gibt Text für übergebene Sprachavriable zurück | string |
writeMonth() | Ersetzt Monat (1-12) in sprachspezifischen String | type |
getMonths() | Gibt sprachspezifische Monate zurück | array |
getDays() | Gibt sprachspezifische Tage zurück | array |
getAll() | Returns full language data | array |
getDaysShort() | Gibt sprachspezifische Tage zurück | array |
write() | Schreibt Text für übergebene Sprachavriable an die Stelle des Aufrufs, sbwp. in einer View | mixed |
saveFiles() | Save language vars to corresponding files | bool |
writeNewFile() | Write file content | bool |
Constants
FILENAME_VARS
mixed
$FILENAME_VARS
= 'vars'
FILENAME_LISTS
mixed
$FILENAME_LISTS
= 'lists'
VARTEXT_NEWLINE
mixed
$VARTEXT_NEWLINE
= '[NL]'
Properties
$langList
Languages list
private
array
$langList
= []
$langCode
Language code
private
string
$langCode
= ''
$langPath
Pfad für Sprachpaket
private
string
$langPath
= ''
$helpFile
Pfad zu Hilfe-Datei
private
string
$helpFile
= ''
$cache
Sprach-Cache
private
cache
$cache
Methods
__construct()
Konstruktor
public
__construct(
[ $langCode :
string
= '' ]
)
: bool
Parameters
- $langCode : string = ''
Return values
boolinit()
Load language variables
private
init(
)
: bool
Tags
Return values
boolgetFileName()
Get language file name and path
private
getFileName(
$name :
string
)
: string|null
Parameters
- $name : string
Tags
Return values
string|nullloadDataFromSystem()
Load language data from file
private
loadDataFromSystem(
$name :
string
)
: void
Parameters
- $name : string
Tags
getModuleLanguage()
fetch module language files
private
getModuleLanguage(
)
: void
addModulePrefix()
Add module prefix to language vars
private
addModulePrefix(
&$val :
string
, $key :
string
, $args :
array
)
: mixed
Parameters
- $val : string
- $key : string
- $args : array
Return values
mixedgetLanguages()
Gibt installierte Sprachpakete zurück
public
getLanguages(
)
: array
Return values
arraygetLangCode()
Gibt aktuellen Sprachcode zurück
public
getLangCode(
)
: string
Return values
stringgetHelp()
Gibt Hilfe-XML-String zurück
public
getHelp(
)
: string
Return values
stringtranslate()
Gibt Text für übergebene Sprachavriable zurück
public
translate(
$langvar :
string
[, $replaceParams :
array
= [] ]
)
: string
Parameters
- $langvar : string
Sprachvariable
- $replaceParams : array = []
Liste von Platzhaltern in der Sprachvariable mit zu ersetzendem Text
- Aufbau: Key = Platzhalter => Value = Text
Return values
stringwriteMonth()
Ersetzt Monat (1-12) in sprachspezifischen String
public
writeMonth(
$monthId :
int
[, $return :
bool
= false ]
)
: type
Parameters
- $monthId : int
- $return : bool = false
Return values
typegetMonths()
Gibt sprachspezifische Monate zurück
public
getMonths(
)
: array
Return values
arraygetDays()
Gibt sprachspezifische Tage zurück
public
getDays(
)
: array
Return values
arraygetAll()
Returns full language data
public
getAll(
)
: array
Tags
Return values
arraygetDaysShort()
Gibt sprachspezifische Tage zurück
public
getDaysShort(
)
: array
Return values
arraywrite()
Schreibt Text für übergebene Sprachavriable an die Stelle des Aufrufs, sbwp. in einer View
public
write(
$langvar :
string
[, $replaceParams :
array
= [] ]
)
: mixed
Parameters
- $langvar : string
Sprachvariable
- $replaceParams : array = []
Liste von Platzhaltern in der Sprachvariable mit zu ersetzendem Text
- Aufbau: Key = Platzhalter => Value = Text
Return values
mixedsaveFiles()
Save language vars to corresponding files
public
saveFiles(
$vars :
array
, $lists :
array
)
: bool
Parameters
- $vars : array
- $lists : array
Tags
Return values
boolwriteNewFile()
Write file content
private
writeNewFile(
$file :
string
, $content :
string
)
: bool
Parameters
- $file : string
- $content : string