SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 47 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

The default
language is configured in the Language Manager and can be overridden by a logged
in user's preferences.
The static JText class is the standard mechanism used to translate strings. JText has
three methods for translating strings, _(), sprintf(), and printf(). The method
that you will probably use most is _(). This method is the most basic; it translates
a string.
In this example, we echo the translation of Monday (if a translation cannot be found
for the string, the original string is returned):
echo JText::_('Monday');
The JText::sprintf() method is comparable to the PHP sprintf() function. We
pass one string to translate and any number of extra parameters to insert into the
translated string. The extra parameters will not be translated.
In this example, if the translation for SAVED_ITEMS is Saved %d items, the returned
value will be Saved 3 items.
$value = JText::sprintf('SAVED_ITEMS', 3);
Alternatively we can use the JText::printf() method. This method is comparable
to the PHP function printf().


Pages:
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6