Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

How to refer to language constant within CB language override file?

  • azjr
  • azjr
  • OFFLINE
  • Posts: 99
  • Thanks: 10
  • Karma: 2
8 years 6 months ago #280683 by azjr
Hi - is there a way to refer to another language constant (i.e. in Joomla override file) within the CB language override. And if yes, how to formulate it? thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 6 months ago #280706 by krileon
Our language file is a PHP file so yes as you can use normal PHP functionality in it. Example as follows for constant or Joomla language string.

Constant:
Code:
'CB_LANGUAGE_KEY' => CONSTANT_HERE,

Joomla Language Key:
Code:
'CB_LANGUAGE_KEY' => JText::_( 'JOOMLA_LANGUAGE_KEY' ),


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: azjr

Please Log in or Create an account to join the conversation.

  • azjr
  • azjr
  • OFFLINE
  • Posts: 99
  • Thanks: 10
  • Karma: 2
8 years 6 months ago #280714 by azjr
OK - that's good.

Now, how about nesting - let's say I need to get a Joomla constant into the confirmation email ('YOUR_REGISTRATION_IS_PENDING_APPROVAL_MESSAGE') so the outcome is a custom content PLUS the constant - what would be the correct syntax here?
like this (?):
Code:
'CB_NESTED_KEY' =>"whatever I want here, plus JText::_( 'JOOMLA_LANGUAGE_KEY' )"

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 6 months ago - 8 years 6 months ago #280746 by krileon
It's PHP so you'd use normal PHP methods to do that. Example as follows.

Code:
'CB_NESTED_KEY' => 'whatever I want here, plus ' . JText::_( 'JOOMLA_LANGUAGE_KEY' ),

You've full access to PHP usage when it comes to CB language files as it's just a PHP file with a big array in it that has its key value pair pushed into our language params which is then output on display.

Using an IDE like phpstorm (commercial) or netbeans (free) will help a lot here as it'll give you syntax highlighting as broken syntax will quickly break your site.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 8 years 6 months ago by krileon.
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

  • azjr
  • azjr
  • OFFLINE
  • Posts: 99
  • Thanks: 10
  • Karma: 2
8 years 6 months ago #280786 by azjr
Cool - that makes sense -thanks.

I do however ran into one oddity, regardless whether I use the constant key or not - and this is in just this one instance: what I'm parsing is the url <a href="..."> in an welcome email
when receiving the email I saw two situation where the link is split into the next line:
a) <a hr
[space] ef="...

or b) <a href=" my.customli
[space] nk...

I was able to take care (somehow) of the first case - but now, regardless of what I do - I get the split link.
With one exception: if I place any other link that already exists within that language constant - that link doesnt' get split... I wonder if this has something to do with the link length? BTW, it's a link to google+
thanks!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 6 months ago #280788 by krileon
Ensure you've enabled HTML registration emails by setting "Registration Email HTML" to "Yes" within CB > Configuration > Registration. Aside from that I've no idea. I'm unable to confirm with multiple link tests. Only the Google+ URL is doing this?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum