Add More Genders Download 2.0

Indonesian Arsalan Shah 5 years ago

A simple component to add more genders. This will add a 3rd gender called others. You may add more genders in array by editing a file components/MoreGenders/ossn_com.php For example in case you wanted to add 4th Gender

 'options' => array(
 'male' => ossn_print('male'),
 'female' => ossn_print('female'),
 'other' => 'Other', 
 'fourth_gender' => '4th Gender',
 )

.

Comments
Indonesian Arsalan Shah Replied 1 year ago

You need to add translation for values, problem doesn't relates to this component but the Extended member using values for translation.

ossn_register_languages('en', array(
        'weiblich' => 'Something',
        'nonbinary' => 'Translation',
        'other' => 'Other',
        'unsure' => 'Unsure',                                   
));
German Dominik L Replied 1 year ago

on profile it is working

enter image description here

but not with "site members"

enter image description here

<?php
/**
 * Open Source Social Network
 *
 * @package   (softlab24.com).ossn
 * @author    OSSN Core Team <[email protected]>
 * @copyright (C) SOFTLAB24 LIMITED
 * @license   Open Source Social Network License (OSSN LICENSE)  http://www.opensource-socialnetwork.org/licence
 * @link      https://www.opensource-socialnetwork.org/
 */
function new_gender_init() {
        ossn_add_hook('user', 'default:fields', 'new_gender');
}
function new_gender($hook, $type, $fields) {
        $toremove           = array(
                'gender'
        );
        $return             = ossn_remove_field_from_fields($toremove, $fields);
        $return['required']['radio'][] =  array(
                                'name' => 'gender',
                                'options' => array(
                                        'male' => ('Mann'),
                                        'female' => ('Frau'),
                                        'Non-binary' => 'Nicht-binär',
                                        'Trans (FTM)' => 'Trans (FTM)',
                                        'Trans (MTF)' => 'Trans (MTF)',
                                        'other' => 'Sonstige',
                                        'unsure' => 'Unsicher',
                                )
        );
        return $return;
}
ossn_register_callback('ossn', 'init', 'new_gender_init', 1000);
Indonesian Arsalan Shah Replied 1 year ago

post your code here

German Dominik L Replied 1 year ago

in english it is working:

enter image description here

but not in German:

enter image description here

Indonesian Arsalan Shah Replied 1 year ago

it already support translation see how male female added in code simply use ossn print function and add translation

German Dominik L Replied 1 year ago

When is the translation support coming?

Indonesian Arsalan Shah Replied 1 year ago

I prefer only Male , Female, Other or Male , Female, Unspecified.

gb Peter Lane Replied 1 year ago

In doing some research on understanding transgender people, gender identity and gender expression, I feel that since the term transgender is not now well received (see American Psychological Association) , that we should only recommend the use of:
Male,
Female,
FTM
MTF
Other

Other would also include those who are unsure. It does not seem right to highlight their dysphoria.

Indonesian Arsalan Shah Replied 1 year ago

Like this

'other' => 'Translations', 
'unsure' => 'Translations',
'trans-mtf' => 'Translation',
German Dominik L Replied 1 year ago

We need translation support.

I added the code

<?php
/**
 * Open Source Social Network
 *
 * @package   (softlab24.com).ossn
 * @author    OSSN Core Team <[email protected]>* @copyright (C) SOFTLAB24 LIMITED
 * @license   Open Source Social Network License (OSSN LICENSE)http://www.opensource-socialnetwork.org/licence* @linkhttps://www.opensource-socialnetwork.org/*/
function new_gender_init() {
        ossn_add_hook('user', 'default:fields', 'new_gender');
}
function new_gender($hook, $type, $fields) {
        $toremove           = array(
                'gender'
        );
        $return             = ossn_remove_field_from_fields($toremove, $fields);
        $return['required']['radio'][] =  array(
                                'name' => 'gender',
                                'options' => array(
                                        'male' => ('Mann'),
                                        'female' => ('Frau'),
                                        'Non-binary' => 'Nicht-binär',
                                        'Trans (FTM)' => 'Trans (FTM)',
                                        'Trans (MTF)' => 'Trans (MTF)',
                                        'other' => 'Sonstige',
                                        'unsure' => 'Unsicher',
                                )
        );
        return $return;
}
ossn_register_callback('ossn', 'init', 'new_gender_init', 1000);

On the login page it is correct but with "extented members" it's not working

Component

Developer: Arsalan
License ossnv3
Type: Uncategorized
Requires Ossn Version : 5.0
Latest Version: 2.0
Last Updated 5 years ago
Repository Url View Repository

Versions