API15

JText: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 26: Line 26:




{{subst:SeeAlso:JText}}
 


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=JText
  category=JText
  category=CodeExample
  namespace=CodeExample
  category=ClassExample
  category=ClassExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>

Latest revision as of 01:13, 25 March 2017

JText is a text handling class. JText allows the developer to specify text-fragments in the source-code, which will be translated into the site's language during runtime.

Defined in

libraries/joomla/methods.php

Methods

Method name Description
_ Translates a string into the current language
sprintf Passes a string thru an sprintf
printf Passes a string thru an printf
script Translate a string into the current language and stores it in the JavaScript language store.

Importing

jimport( 'joomla.methods' );



Examples

Code Examples

Simple text strings

    echo JText::_( 'Welcome' );

see also: http://docs.joomla.org/Tutorial:Template_translations