Skip to Content Skip to Menu

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

Translating values custom fields

  • WebAccent
  • WebAccent
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
11 years 9 months ago #219467 by WebAccent
Translating values custom fields was created by WebAccent
Hi everybody,

Could anyone give me guidelines how to translate the labels and values of a custom field (such as a dropdown multiselect, checkbox multiple , radio buttons)?

Thanks

Dieter

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #219483 by krileon
Replied by krileon on topic Translating values custom fields
Easiest method is to use defines. For example _UE_MYFIELD. Then within your CB language files you'll define the text for it; example as follows.

define( '_UE_MYFIELD', 'My field' );

This would be added to the below language file for example. Note it's recommended you download the English language plugin and edit it instead of editing the default language files.

components/com_comprofiler/plugin/language/default_language/default_language.php


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.

  • WebAccent
  • WebAccent
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
11 years 9 months ago #219531 by WebAccent
Replied by WebAccent on topic Translating values custom fields
Thanks for the reply, now I am indeed able to translate my labels.

I encounter following problems though:
- When I put define( '_UE_MYFIELD', 'My field in Chinese' ) in the foreign language.php-file, I get the right translation indeed but I lose my English translation. When I put the same piece of code in the default_language.php code (but then translated in English), it does not show. What am I doing wrong?

- I would like to translate all the options within for example the radio button list. Where do I translate each single option?

See annex



Thanks for the nice support!
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #219573 by krileon
Replied by krileon on topic Translating values custom fields
My guess is English isn't working because you probably have the English language plugin installed. Check for the below language files.

components/com_comprofiler/plugin/language/en-gb/


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.

  • WebAccent
  • WebAccent
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
11 years 9 months ago #219635 by WebAccent
Replied by WebAccent on topic Translating values custom fields
Hi,

I don't have the English language plugin installed (I do not have the folder en-gb).

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #219653 by krileon
Replied by krileon on topic Translating values custom fields
You've some other language plugin loading instead of the default language plugin then. Ensure you've placed your new define at the very bottom of the language file. Enable debug mode and maximum error reporting in Joomla global configuration to expose any errors.


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