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!

[SOLVED] Translate Drop-down field content

7 years 5 months ago - 7 years 5 months ago #296051 by sylvain.ruda
Replied by sylvain.ruda on topic Translate Drop-down field content
So if i understand well :

1. I put in my language plugin a key and a string. For exemple : TRUC / bidule
2. CBTxt::T( 'TRUC ' ) will return "bidule" if i am in the rigth language.

Is it right ?
Last edit: 7 years 5 months ago by sylvain.ruda.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48708
  • Thanks: 8319
  • Karma: 1447
7 years 5 months ago #296053 by krileon
Replied by krileon on topic Translate Drop-down field content
Correct, you can use just a key using CBTxt::T( 'KEY' ) and it will translate to whatever string you have specified in your language file.


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.

7 years 5 months ago #296080 by sylvain.ruda
Replied by sylvain.ruda on topic Translate Drop-down field content
Hi,

I think i'm doing something wrong...

In My CB Builder fr-FR plugin i put an override :
Key : MASCULIN
Text : xxx

in my Component i do this :
echo ( CBTxt::T('MASCULIN') );

The output of my echo function is still "MASCULIN".

Can you tell me how tot do ?

Regards,

Sylvain ruda

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48708
  • Thanks: 8319
  • Karma: 1447
7 years 5 months ago #296087 by krileon
Replied by krileon on topic Translate Drop-down field content
You need to be viewing your site in the French language. Try adding your override to the Default language plugin to see if English is being loaded. Aside from that you may have an issue with the API not being loaded. See the below regarding loading in CBs API.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18357-including-cb-api-for-usage-outside-of-cb

Once loaded in if you need language files loaded you need to call the below.

Code:
cbimport( 'language.front' );


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.

7 years 5 months ago #296097 by sylvain.ruda
Replied by sylvain.ruda on topic Translate Drop-down field content
Thanks ! it works fine now :)
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum