[SOLVED] Language-dependent pull-down menus during registration

10 years 2 months ago - 10 years 2 months ago #241036 by MacPhotoBiker
Hi,

I'm in the process of building a bilingual CB site (French and English). During registration, users should select their month of birth, so if language is French, I'd like to show "Janvier" instead of January.

I managed to do so by defining a constant in file "language.php".

My question is this: Based on the month of birth, we later want to create lists of people with birthday in a particular month. If I proceed by allowing French and English, the database will show 24 different months, not only 12.

When creating a list, I would like for example that if "January" gets selected, all users with month "Janvier" get selected as well, or vice versa.

I can see two approaches:

1) I could show numbers for the months (01,02 etc.) However, I'd prefer the more elegant way to show "January" and "Janvier", so that's not really an option.

2) When creating lists, I could select "Month = January OR Month = Janvier". However, this calls for errors, so it's also not really an option.

What I'd like to see is this: When a user selects a month, could there be a second field related to it that would be populated depending by the selection?

For example, if MONTH = January is selected, then a hidden field MONTH_NUMERIC would be populated with 1. And also, if MONTH = Janvier is selected, MONTH_NUMERIC would be 1. In the monthly reports for birthdays I could then make reference to MONTH_NUMERIC, and I would be language independent.

Could this be done?

I'm aware that for birthdays this might not be overly important, and I could solve it by only allowing numeric months in English or French. However, I'd like to understand in general if the concept I described could be implemented.

Thanks a lot!

Please Log in to join the conversation.

10 years 2 months ago #241055 by krileon
Currently you can't have separate labels and values. You can in CB 2.0, but not 1.x. In 1.x you have to use language strings to accomplish this. Example as follows.

Value: _UE_JANUARY

define( '_UE_JANUARY', 'January' );

You won't be able to really use the numerical value in 1.x and have it translate correctly, but again in CB 2.0 this won't be a problem.


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 to join the conversation.

10 years 2 months ago - 10 years 2 months ago #241064 by MacPhotoBiker
Replied by MacPhotoBiker on topic Language-dependent pull-down menus during registration
Hi Kyle,

thanks for looking into it. I'm not sure if I quite understand, please help me to clarify it a bit.

All I would need is an additional calculated (hidden) field, where I could define calculation rules like (IF Month = "January" or "Month = "Janvier", THEN "01")

This way, the calculated field would always be "01", no matter if "January" or "Janvier" would be selected.

On a separate note: I'm building a website completely from scratch, CB, CBSubs and an Event Management tool will be core features. I'm building on 1.9, because I need a solid solution up and running within 2 to 4 weeks.

Would you say CB 2 is ready for a production environment? I was hesitating especially because of concerns that plugins might not be compatible for some time.

Thanks again for looking into it.


Gert

Please Log in to join the conversation.

10 years 2 months ago #241079 by krileon

All I would need is an additional calculated (hidden) field, where I could define calculation rules like (IF Month = "January" or "Month = "Janvier", THEN "01")

This way, the calculated field would always be "01", no matter if "January" or "Janvier" would be selected.

No, you don't need that at all. What is the significance of 01? Do you need it to be 01 for some particular reason? When using language strings like _UE_JANUARY the value stored to the database is always _UE_JANUARY. It will translate the language string on display so it's a completely multilingual value. So whether they select January or Janvier it's always stored as _UE_JANUARY.

Would you say CB 2 is ready for a production environment?

No, none of our plugins will install on CB 2.0. At least not yet. Once CB 2.0 stable is released I'll be upgrading the plugins for it. If all you need is core functionality then it should be fine.


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.
The following user(s) said Thank You: MacPhotoBiker

Please Log in to join the conversation.

10 years 2 months ago #241086 by MacPhotoBiker
Replied by MacPhotoBiker on topic Language-dependent pull-down menus during registration
Hi Kyle,

thanks a lot for clarifying!

Here's the story behind it: I'm creating that website for a group of people who are not very tech-savvy. Every month they will have to pull a list of members with birthday of that particular month. My concern was that they will always have to think of two parameters for one month (Janvier and January), but I understand now that this is not the case. The filter will be _UE_JANUARY anyway, no matter which language is selected.

That's pretty cool and just answered my question! Thank you very much!!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.188 seconds

Facebook Twitter LinkedIn