Questions tagged [jtext]
The jtext tag has no usage guidance.
7
questions
0
votes
1
answer
34
views
Special character (%) in language string
I want to output a float price using a language constant like this:
MYCONST_VAT="incl. %.2f% VAT"
So doing this:
echo Text::sprintf('MYCONST_VAT', 19);
outputs:
incl. 19.00% VAT
...
3
votes
0
answers
89
views
Why can I not use a params variable for the JText translation constant?
I'm working on a component, and within the component configuration I have a selector for the admin to choose the date format to use when displaying items. It seems to me a perfect use-case for ...
2
votes
1
answer
567
views
Joomla 4.0 Text sprintf
I know at some point sprintf was a method of the JText class, but it doesn't seem to work in Joomla 4.0. I tried the following, not working:
$str = Text::sprintf('...
1
vote
1
answer
107
views
Language Constants not being replaced in JLayout
I am trying to use Jlayout in a plugin I am writing and everything works fine except that the Language Constants in the layout file are not being replaced.
My call to render the layout is;
$layout = ...
2
votes
1
answer
379
views
Using language constants in external file
How can I use language constant like JText::_('MY_STRING_FROM_INI_FILE') in external file?
UPD:
I include joomla system files
require_once JPATH_BASE . '/includes/defines.php';
require_once ...
2
votes
2
answers
1k
views
How to rewrite JText to get my custom text translations from Database and not from files
I managed to rewrite system plugin "Language Manager", so now it saves texts for different languages to Database (DB).
Now I do not know how to rewrite JText (that is present across all the ...
2
votes
1
answer
587
views
JText - multilingual string order
I have an extension that displays the time a shout was posted, for example:
1 day ago
This string is generated in my helper like so:
$num . ' ' . JText::_('SHOUT_TIME') . ' ' . JText::_('...