Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to call language label text?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 12-10-2016, 08:32 AM
 
sabinudash sabinudash is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 66
 

Default How to call language label text?

Hi,

I added a new label (Translations > Edit labels > Add new label). How would I call the new label text on front pages?

Would you please share the code?

For Xcart 4, it used to be something like:
Quote:
{$lng.lbl_label_name}

What code should I use for Xcart 5?

Thanks for any help.
__________________
X-Cart 5.3.3.4 Multivendor
X-Cart 5.3.3.4 Business (Testing)
Reply With Quote
  #2  
Old 12-11-2016, 09:57 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: How to call language label text?

In Twig templates you should use the t() function:
http://devs.x-cart.com/en/basics/twig_guide.html#t

In PHP classes you can use the static::t() method. For an example, see this article:
http://devs.x-cart.com/en/getting_started/step_4_-_working_with_settings/creating_custom_setting_class.html
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:02 AM.

   

 
X-Cart forums © 2001-2020