Back to Joomla project (class list)

Class Text - list of methods

Text handling class.
Package: Joomla\CMS\Language
Copyright: (C) 2007 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Language/Text.php
Project: Joomla

Method Summary

public static string
(mixed $string, mixed $jsSafe = false, mixed $interpretBackSlashes = true, mixed $script = false)

Translates a string into the current language.
Parameters
  • string $string The string to translate.
  • mixed $jsSafe Boolean: Make the result javascript safe.
  • bool $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation)
  • bool $script To indicate that the string will be push in the javascript language store
Returns
  • string The translated string or the key if $script is true
Since
  • 1.7.0
Show source code of this method: _ Source Code

private static bool
(mixed &$string, mixed $jsSafe = false, mixed $interpretBackSlashes = true, mixed $script = false)

Checks the string if it should be interpreted as sprintf and runs sprintf over it.
Parameters
  • string & $string The string to translate.
  • mixed $jsSafe Boolean: Make the result javascript safe.
  • bool $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation)
  • bool $script To indicate that the string will be push in the javascript language store
Returns
  • bool Whether the string be interpreted as sprintf
Since
  • 3.4.4
Show source code of this method: passSprintf Source Code

public static string
(mixed $string, mixed $alt, mixed $jsSafe = false, mixed $interpretBackSlashes = true, mixed $script = false)

Translates a string into the current language.
Parameters
  • string $string The string to translate.
  • string $alt The alternate option for global string
  • mixed $jsSafe Boolean: Make the result javascript safe.
  • bool $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation)
  • bool $script To indicate that the string will be pushed in the javascript language store
Returns
  • string The translated string or the key if $script is true
Since
  • 1.7.0
Show source code of this method: alt Source Code

public static string
(mixed $string, mixed $n)

Like Text::sprintf but tries to pluralise the string.
Parameters
  • string $string The format string.
  • int $n The number of items
Returns
  • string The translated strings or the key if 'script' is true in the array of options
Since
  • 1.7.0
Show source code of this method: plural Source Code

public static string
(mixed $string)

Passes a string thru a sprintf.
Parameters
  • string $string The format string.
Returns
  • string The translated strings or the key if 'script' is true in the array of options.
Since
  • 1.7.0
Show source code of this method: sprintf Source Code

public static mixed
(mixed $string)

Passes a string thru an printf.
Parameters
  • string $string The format string.
Returns
  • mixed
Since
  • 1.7.0
Show source code of this method: printf Source Code

public static array
(mixed $string = null, mixed $jsSafe = false, mixed $interpretBackSlashes = true)

Translate a string into the current language and stores it in the JavaScript language store.
Parameters
  • string $string The Text key.
  • bool $jsSafe Ensure the output is JavaScript safe.
  • bool $interpretBackSlashes Interpret \t and \n.
Returns
  • array
Since
  • 1.7.0
Show source code of this method: script Source Code

public static array
()

Get the strings that have been loaded to the JavaScript language store.
Returns
  • array
Since
  • 3.7.0
Show source code of this method: getScriptStrings Source Code

Properties Summary

protected static array
$strings
JavaScript strings
Since
  • 1.7.0

Tags Summary

Since
1.7.0