PotentiallyTranslatedString
class PotentiallyTranslatedString implements Stringable (View source)
Properties
| protected string | $string | The string that may be translated. |
|
| protected string|null | $translation | The translated string. |
|
| protected Translator | $translator | The validator that may perform the translation. |
Methods
Translate the string.
Translates the string based on a count.
Get the original string.
Get the potentially translated string.
Get the potentially translated string.
Details
__construct(string $string, Translator $translator)
Create a new potentially translated string.
$this
translate(array $replace = [], string|null $locale = null)
Translate the string.
$this
translateChoice(Countable|int|float|array $number, array $replace = [], string|null $locale = null)
Translates the string based on a count.
string
original()
Get the original string.
string
__toString()
Get the potentially translated string.
string
toString()
Get the potentially translated string.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.