Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

cb_privacy language strings

7 years 11 months ago #291053 by jeroen aalders
cb_privacy language strings was created by jeroen aalders
Looking in the component.cbprivacy.php file, I see that there are lines such as:

$subject = CBTxt::T( 'Your Account has been Disabled' );

The default language file contains lines like:

'YOUR_ACCOUNT_HAS_BEEN_DISABLED_529b32' => 'Your Account has been Disabled',

If I go to language overrides and search for (without the quotes) 'Your Account has been Disabled', 'YOUR_ACCOUNT_HAS_BEEN_DISABLED_529b32' or even 'YOUR_ACCOUNT_HAS_BEEN_DISABLED', nothing is found.

Now, perhaps I misunderstand how the mechanism of CBTxt::T( 'Hard-coded string' ) works or how language overrides work, but it appears that what is actually being used by my instance of CB is the hard-coded string from cbprivacy.component.php. This cannot be correct, surely.

If I change the hard-coded string I lose multi-language capabilities and run the risk of an upgrade of cb_privacy overwriting my strings.

What is going on? Please, advise.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 11 months ago #291077 by krileon
Replied by krileon on topic cb_privacy language strings
Works perfectly fine for me when searching the default language plugin. Ensure CB and CB Privacy are both up to date.




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.
Attachments:

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

7 years 11 months ago #291364 by jeroen aalders
Replied by jeroen aalders on topic cb_privacy language strings
I tried it again and, this time, I could find the strings. I have no idea why it didn't work, earlier. However, this is really a side issue to the problem.

The real problem is that, even if I create overrides for those strings that I want to change, it still uses the strings that are hard-coded into component.cbprivacy.php

This doesn't surprise me because of lines, such as I mentioned in my earlier post: e.g. $subject = CBTxt::T( 'Your Account has been Disabled' );
Shouldn't this read $subject = CBTxt::T('YOUR_ACCOUNT_HAS_BEEN_DISABLED_529b32', 'Your Account has been Disabled' );

Now, looking at the T function of the CBTxt class, I find that it is: public static function T( $languageKeys, $englishString = null, array $args = array() ). Therefore, my limited understand says that, if there is only one parameter, the $englishString variable remains as null and only the string that is the first parameter will be returned.

The net result is that the string that is returned is neither the original string in the language file, nor the override, but the hard-coded one. The first (and only) parameter of this function is a hard-coded string. In what way is my thinking wrong on this?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 11 months ago #291389 by krileon
Replied by krileon on topic cb_privacy language strings
If the array key YOUR_ACCOUNT_HAS_BEEN_DISABLED_529b32 or 'Your Account has been Disabled' exists in your language files then its value will be used. Either of the following will work.

Key: YOUR_ACCOUNT_HAS_BEEN_DISABLED_529b32
Value: TEST

Key: Your Account has been Disabled
Value: TEST

My guess is whatever language plugin you're supplying the override to is not being loaded when that email is being sent. Are you adding your overrides to the default language plugin? I have confirmed it works fine adding to the default language plugin.


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