Documentation

CalculationLocale extends CalculationBase
in package

Table of Contents

Constants

CALCULATION_REGEXP_STRIP_XLFN_XLWS  = '/(_xlfn[.])?(_xlws[.])?(?=[\p{L}][\p{L}\p{N}\.]*[\s]*[(])/'
FORMULA_CLOSE_FUNCTION_BRACE  = ')'
FORMULA_CLOSE_MATRIX_BRACE  = '}'
FORMULA_OPEN_FUNCTION_BRACE  = '('
FORMULA_OPEN_MATRIX_BRACE  = '{'
FORMULA_STRING_QUOTE  = '"'

Properties

$falseTrueArray  : array<int, array<int, string>>
$functionReplaceFromLocale  : array<string|int, mixed>|null
$functionReplaceToExcel  : array<string|int, mixed>|null
$localeArgumentSeparator  : string
Locale-specific argument separator for function arguments.
$localeBoolean  : array<string, string>
Locale-specific translations for Excel constants (True, False and Null).
$localeFunctions  : array<string|int, mixed>
$localeLanguage  : string
The current locale setting.
$validLocaleLanguages  : array<string|int, string>
List of available locale settings Note that this is read for the locale subdirectory only when requested.
$functionReplaceFromExcel  : array<string|int, mixed>|null
$functionReplaceToLocale  : array<string|int, mixed>|null

Methods

addFunction()  : bool
getFALSE()  : string
Return the locale-specific translation of FALSE.
getFalseTrueArray()  : array<int, array<int, string>>
getFunctions()  : array<string|int, mixed>
Get a list of all implemented functions as an array of function objects.
getLocale()  : string
Get the currently defined locale code.
getLocaleBoolean()  : string
getTRUE()  : string
Return the locale-specific translation of TRUE.
localeFunc()  : string
removeFunction()  : bool
setLocale()  : bool
Set the locale code.
translateFormulaToEnglish()  : string
translateFormulaToLocale()  : string
translateSeparator()  : string
getFunctionsAddress()  : array<string, array<string, mixed>>
Get address of list of all implemented functions as an array of function objects.
getLocaleFile()  : string
loadLocales()  : void
translateFormula()  : string
translateFormulaBlock()  : string

Constants

CALCULATION_REGEXP_STRIP_XLFN_XLWS

public mixed CALCULATION_REGEXP_STRIP_XLFN_XLWS = '/(_xlfn[.])?(_xlws[.])?(?=[\p{L}][\p{L}\p{N}\.]*[\s]*[(])/'

Properties

$falseTrueArray

protected static array<int, array<int, string>> $falseTrueArray = []

$functionReplaceFromLocale

protected static array<string|int, mixed>|null $functionReplaceFromLocale

$functionReplaceToExcel

protected static array<string|int, mixed>|null $functionReplaceToExcel

$localeArgumentSeparator

Locale-specific argument separator for function arguments.

protected static string $localeArgumentSeparator = ','

$localeBoolean

Locale-specific translations for Excel constants (True, False and Null).

protected static array<string, string> $localeBoolean = ['TRUE' => 'TRUE', 'FALSE' => 'FALSE', 'NULL' => 'NULL']

$localeFunctions

protected static array<string|int, mixed> $localeFunctions = []

$localeLanguage

The current locale setting.

protected static string $localeLanguage = 'en_us'

$validLocaleLanguages

List of available locale settings Note that this is read for the locale subdirectory only when requested.

protected static array<string|int, string> $validLocaleLanguages = ['en']

$functionReplaceFromExcel

private static array<string|int, mixed>|null $functionReplaceFromExcel

$functionReplaceToLocale

private static array<string|int, mixed>|null $functionReplaceToLocale

Methods

addFunction()

public static addFunction(string $key, array<string, array<string, mixed>> $value) : bool
Parameters
$key : string
$value : array<string, array<string, mixed>>
Return values
bool

getFALSE()

Return the locale-specific translation of FALSE.

public static getFALSE() : string
Return values
string

locale-specific translation of FALSE

getFalseTrueArray()

public getFalseTrueArray() : array<int, array<int, string>>
Return values
array<int, array<int, string>>

getFunctions()

Get a list of all implemented functions as an array of function objects.

public static getFunctions() : array<string|int, mixed>

return array<string, array<string, mixed>>

Return values
array<string|int, mixed>

getLocale()

Get the currently defined locale code.

public getLocale() : string
Return values
string

getLocaleBoolean()

public static getLocaleBoolean(string $index) : string
Parameters
$index : string
Return values
string

getTRUE()

Return the locale-specific translation of TRUE.

public static getTRUE() : string
Return values
string

locale-specific translation of TRUE

localeFunc()

public static localeFunc(string $function) : string
Parameters
$function : string
Return values
string

removeFunction()

public static removeFunction(string $key) : bool
Parameters
$key : string
Return values
bool

setLocale()

Set the locale code.

public setLocale(string $locale) : bool
Parameters
$locale : string

The locale to use for formula translation, eg: 'en_us'

Return values
bool

translateFormulaToEnglish()

public translateFormulaToEnglish(string $formula) : string
Parameters
$formula : string
Return values
string

translateFormulaToLocale()

public translateFormulaToLocale(string $formula) : string
Parameters
$formula : string
Return values
string

translateSeparator()

public static translateSeparator(string $fromSeparator, string $toSeparator, string $formula, int &$inBracesLevel[, string $openBrace = self::FORMULA_OPEN_FUNCTION_BRACE ][, string $closeBrace = self::FORMULA_CLOSE_FUNCTION_BRACE ]) : string
Parameters
$fromSeparator : string
$toSeparator : string
$formula : string
$inBracesLevel : int
$openBrace : string = self::FORMULA_OPEN_FUNCTION_BRACE
$closeBrace : string = self::FORMULA_CLOSE_FUNCTION_BRACE
Return values
string

getFunctionsAddress()

Get address of list of all implemented functions as an array of function objects.

protected static & getFunctionsAddress() : array<string, array<string, mixed>>
Return values
array<string, array<string, mixed>>

getLocaleFile()

protected getLocaleFile(string $localeDir, string $locale, string $language, string $file) : string
Parameters
$localeDir : string
$locale : string
$language : string
$file : string
Return values
string

translateFormula()

protected static translateFormula(array<string|int, mixed> $from, array<string|int, mixed> $to, string $formula, string $fromSeparator, string $toSeparator) : string
Parameters
$from : array<string|int, mixed>
$to : array<string|int, mixed>
$formula : string
$fromSeparator : string
$toSeparator : string
Return values
string

translateFormulaBlock()

protected static translateFormulaBlock(array<string|int, mixed> $from, array<string|int, mixed> $to, string $formula, int &$inFunctionBracesLevel, int &$inMatrixBracesLevel, string $fromSeparator, string $toSeparator) : string
Parameters
$from : array<string|int, mixed>
$to : array<string|int, mixed>
$formula : string
$inFunctionBracesLevel : int
$inMatrixBracesLevel : int
$fromSeparator : string
$toSeparator : string
Return values
string

        
On this page

Search results