Translate Fields Options in Community Builder

Discuss the development and implementation of Joomla! components here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
alantygel
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Aug 24, 2005 2:46 pm

Translate Fields Options in Community Builder

Post by alantygel » Wed Nov 09, 2005 12:01 pm

Hey,
I've made a hack to allow people to translate fields option in the CB component.

When you create a new field, for example, a radio, drop-down select or multi-select, name your values with names starting with "_" (underscore, without quotes) .
Ex.: Values:

_UE_FIRST_OPTION
_UE_SEC_OPTION

Define these names in your language file.
Ex.:

Code: Select all

DEFINE('_UE_FIRST_OPTION','First Option');
DEFINE('_UE_SEC_OPTION','Second Option');
Here comes the trick:

In file administrator/com_comprofiler/comprofiler.class.php:
Before the line

Code: Select all

 $results .= "\n\t\t\t\t\t<td>".$oValue."</td>";
Add the code:

Code: Select all

 if ($oValue[0] == "_") 
    $oValue = constant($oValue);
With this, CB will convert the string _UE_FIRST_OPTION in the choosed language, using the language file.

If you have any doubts, ask me here.

Alan Tygel

Herremansm
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Oct 10, 2012 1:37 pm

Re: Translate Fields Options in Community Builder

Post by Herremansm » Wed Sep 18, 2013 6:50 am

hi there,

I can't find the code $results .= "\n\t\t\t\t\t<td>".$oValue."</td>"; in the comprofiler.class.php

How does it come?

Thanks


Locked

Return to “Components”