Kit Fenderson-Peters ([info]popefelix) wrote in [info]lj_dev,
@ 2008-05-14 10:28:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Adding genders
I have one very good friend who considers themself to be neither male or female gendered, and who does not care to list themself as "unspecified". And it seems to me that it's a good thing to support more genders than just "Male", "Female", and "Unspecified". So I'm adding it to Inksome. But I have a problem. I modify the requisite section in /manage/profile/index.bml:

 # gender
        $ret .= "<tr><td class="field_name">$ML{'.fn.gender'}</td><td>";
        $ret .= LJ::html_select({ 'name' => 'gender', 'selected' => $u->{'gender'} },
                                  'U' => $ML{'.gender.unspecified'},
                                  'M' => $ML{'.gender.male'},
                                  'F' => $ML{'.gender.female'},
                                  'O' => $ML{'.gender.other'}, # ADDED
                                  'N' => $ML{'.gender.none'} # ADDED
                               );
        $ret .= "</td></tr>\n";


And

 # opts
            $POST{'opt_showmutualfriends'} = $POST{'opt_showmutualfriends'} ? 1 : 0;
            $POST{'opt_hidefriendofs'} = $POST{'opt_hidefriendofs'} ? 0 : 1;
            $POST{'opt_showschools'} = 'N' unless $POST{'opt_showschools'} =~ m/^(N|R|Y|F)$/;
            $POST{'gender'} = 'U' unless $POST{'gender'} =~ m/^[UONMF]$/; # MODIFIED


And I add the requisite bits in lj/htdocs/manage/profile/index.bml.text:

.friendof=Show other users who have friended you, but you have not friended

.gender.other=Other

.gender.none=None

.gender.female=Female

.gender.male=Male

.gender.unspecified=(Unspecified)


Note there that I added ".gender.other" and ".gender.none".

So then I thought that maybe it was lj/htdocs/editinfo.bml.txt that I needed to fiddle, adding:

.gender.other=Other

.gender.none=None


But that didn't do it either. So I'm stumped. Any ideas?


(Post a new comment)


[info]henrylyne
2008-05-23 05:46 am UTC (link)
You didn't really state your problem. "It" didn't do what? What part is not working?

(Reply to this)(Thread)


[info]popefelix
2008-05-23 12:39 pm UTC (link)
Sorry. I get this HTML for the "Other" option, for example:

<option value="O"></option>

When I expected

<option value="O">Other</option>

(Reply to this)(Parent)


[info]ciaran_h
2008-05-23 08:07 am UTC (link)
I'm not quite sure how the text strings work, but my guess is you might have to run "$LJHOME/bin/upgrading/texttool.pl load" in order to load the new text strings into the database. After that, it might work.

(Reply to this)(Thread)


[info]popefelix
2008-05-23 12:37 pm UTC (link)
Ah! I didn't realize that those strings weren't read directly from the .text files.

(Reply to this)(Parent)(Thread)


[info]ciaran_h
2008-05-23 12:41 pm UTC (link)
Well, that's the thing - I'm not quite sure how it works, whether they're read directly or not. But given what I know about it, I'm guessing that texttool.pl loads to the database. Did it solve your problem?

(Reply to this)(Parent)(Thread)


[info]popefelix
2008-05-23 12:42 pm UTC (link)
Dunno, haven't tried. I'm eating breakfast. :)

(Reply to this)(Parent)(Thread)


[info]popefelix
2008-05-23 12:48 pm UTC (link)
Yes, that was it. Thank you!

Of course, when I couldn't get it to work initially, I just did $ML{'.gender.other''} || 'Other'. :)

(Reply to this)(Parent)


[info]pbristow
2008-05-23 06:20 pm UTC (link)
"it seems to me that it's a good thing to support more genders than just "Male", "Female", and "Unspecified"."

Just to say well done for getting on to this. Let's hope it gets picked up and rolled out on LJ "proper" ASAP.

(Reply to this)(Thread)


[info]popefelix
2008-05-23 06:25 pm UTC (link)
Thanks. Of course, you could always just come over to Inksome where we have it done already. :)

(Reply to this)(Parent)(Thread)


[info]pne
2008-05-24 07:30 am UTC (link)
Do you have an invite code to give out?

(Reply to this)(Parent)(Thread)


[info]popefelix
2008-05-24 02:45 pm UTC (link)
Yes, though I'd prefer that you bought a paid account - it's only $10 for 3 months' time, and it helps me keep the hosting bills paid. :)

(Reply to this)(Parent)(Thread)


[info]pne
2008-05-24 03:12 pm UTC (link)
Fair enough.

(Reply to this)(Parent)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…