TranslatableString
in package
implements
TranslatableStringInterface
Class for translatable string with a special default translation.
Tags
Interfaces, Classes, Traits and Enums
- TranslatableStringInterface
- Interface for translatable strings.
Table of Contents
- $displayString : string
- Default display string
- $string : string
- Original string
- $translatable : bool
- Whether translation is allowed
- __construct() : mixed
- Constructor
- __toString() : string
- Return the original string by default
- getDisplayString() : string
- Return string for display if raw value has no translation available (can be further translated)
- isTranslatable() : bool
- Checks if the string can be translated
Properties
$displayString
Default display string
protected
string
$displayString
$string
Original string
protected
string
$string
$translatable
Whether translation is allowed
protected
bool
$translatable
Methods
__construct()
Constructor
public
__construct(string $string, string $displayString[, bool $translatable = true ]) : mixed
Parameters
- $string : string
-
Original string
- $displayString : string
-
Translatable display string
- $translatable : bool = true
-
Whether translation is allowed
Return values
mixed —__toString()
Return the original string by default
public
__toString() : string
Return values
string —getDisplayString()
Return string for display if raw value has no translation available (can be further translated)
public
getDisplayString() : string
Return values
string —isTranslatable()
Checks if the string can be translated
public
isTranslatable() : bool