Registration URL Request

8 years 11 months ago #144523 by LenajL

Use language strings to adjust the title. Example as follows.

[code:1]
Values:

Code:

001

002

003

004

005

006 [/code:1]

Lang Strings:

[code:1]
'001' => 'Test Value 1',

'002' => 'Test Value 2',

'003' => 'Test Value 3',

'004' => 'Test Value 4',

'005' => 'Test Value 5',

'006' => 'Test Value 6' [/code:1]


Output:
[code:1]
Code:

<option value="001">Test Value 1</option>

<option value="002">Test Value 2</option>

<option value="003">Test Value 3</option>

<option value="004">Test Value 4</option>

<option value="005">Test Value 5</option>

<option value="006">Test Value 6</option>[/code:1]


Can you explane me more detailed?
I have no idea what to write in the language string. (Sorry i am not very familiar with php, tried to read a lot about i but haven't got it at all)

So for example: 1 Have a dropdown with female and male. I want the values to be 1 for female and 2 for male.

The code would be
[code:1]
female
male[/code:1]

and the language string
[code:1]
<option value="001">female</option>
<option value="002">male</option>[/code:1]

i use german.php found in comprofiler/plugin/language/german



but what do i have exactly to do? Can you tell what do i have to write? I don't know cause in this file only variables are defined - all this made me confused ;)

Post edited by: LenajL, at: 2010/10/21 15:34
8 years 11 months ago #144536 by krileon
I've already explained what to write in the language string, re-read my reply. Not much more to suggest, sorry. CB drop-downs set the value and title 1 in the same. You can translate the title using CB language strings such as the following (a drop-down select with 2 values of 001 and 002).

HTML:
[code:1]
<option value="001">001</option>
<option value="002">002</option>
[/code:1]

Lang Strings:
[code:1]
'001' => 'Male',
'002' => 'Female',
[/code:1]

Result:
[code:1]
<option value="001">Male</option>
<option value="002">Female</option>
[/code:1]

You need to edit the cbteamplugins language file. You can add defines if you want just review how the defines are structured and make your translations then.

Post edited by: krileon, at: 2010/10/21 16:57


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
8 years 11 months ago #144544 by LenajL
I tried what you wrote to me. Sorry I haven't seen that its the cbteamplugins_language that has to be changed.
Anyway, I created a Dropdown (Select) and Named the field Sex, the Titel is Sex as well. The values which can be selected are "male" and "female". In the cbteamplugins_language i wrote:

[code:1]
// Select values
CBTxt::addStrings( array(
'male' => '1',
'female' => '2'
));[/code:1]


but there is no change. Not in database, not in frontent, not in backend. :(

What am I doing wrong?

Post edited by: LenajL, at: 2010/10/21 18:38
8 years 11 months ago #144552 by krileon
Your usage looks fine, but the values must match exactly. Is it male or Male and female or Female. It must match word for word and case for case. Please ensure the values are EXACTLY as specified by the field. Lang strings will NOT adjust your database. It only affects frontend/backend display. You need to also ensure this is in your language string. If you're using German then it must be in the German cbteamplugins lang file. You can try defines as follows.

[code:1]
define( 'male', '1' );
define( 'female', '2' );
[/code:1]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
8 years 11 months ago #144561 by LenajL
yes i know its case-sensitive (great, i learned something while reading php tutorial :) ) but its not working.

your new suggestion breaks down my cb backend.

But anyway I would need something to change even my database values.

What a pitty. Well, as i query the data in the jos_comprofiler i will have to find a way to set up my query in order to be able to show male and female in the new established table as mentioned (1;2).


Thank you very much for your help.
8 years 11 months ago #144563 by krileon
Sorry, not much more I can advise. That's the usage and confirmed it working perfectly fine. If you want database values of 1 and 0 with display of male and female then you'll need to set the fields values to 1 and 0 then translate it that way, see below example.

[code:1]
// Select values
CBTxt::addStrings( array(
'1' => 'male',
'2' => 'female'
));
[/code:1]

The strings work as follows.

'REAL VALUE' => 'DISPLAYED VALUE'


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.410 seconds
Facebook Twitter Google LinkedIn