Skip to Content Skip to Menu

[SOLVED] language vars in php

10 years 8 months ago - 10 years 8 months ago #240611 by thewebsurfer
[SOLVED] language vars in php was created by thewebsurfer
hi, quick question:
my registration form has some CB language vars value field, so in the database i store the CB lang vars (is that technically correct?).
in the helloworld plugin im using some of those CB vars, how can i translate them?
Last edit: 10 years 8 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #240657 by krileon
Replied by krileon on topic language vars in php
Yes, it's correct to store language strings in database. This allows them to translate on display to any language.

To translate through API it entirely depends on what you used. If you used defines then run them through getLangDefinition. If it's CBTxt usage then run it though CBTxt::T(). Examples as follows.

$text = getLangDefinition( '_UE_MY_STRING' );
$text = CBTxt::T( 'My String' );


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.

10 years 8 months ago #240701 by thewebsurfer
Replied by thewebsurfer on topic language vars in php
ok i solved with getLangDefinition thanks

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

10 years 8 months ago #240719 by thewebsurfer
Replied by thewebsurfer on topic [SOLVED] language vars in php
what should i include for use getLangDefinition in some external php code?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #240805 by krileon
Replied by krileon on topic [SOLVED] language vars in php
External PHP code where? You mean a PHP file outside of Joomla entirely? You can't. You can include CB API externally, but it still needs to be inside of Joomla. Running a PHP file directly instead of through Joomla won't load any Joomla API, etc..


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.

10 years 8 months ago #240808 by thewebsurfer
Replied by thewebsurfer on topic [SOLVED] language vars in php
obiouvsly in joomla, i mean in jumi app

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

Moderators: beatnantkrileon
Powered by Kunena Forum