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',
)
.
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',
));
on profile it is working
but not with "site members"
<?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);
post your code here
in english it is working:
but not in German:
it already support translation see how male female added in code simply use ossn print function and add translation
When is the translation support coming?
I prefer only Male , Female, Other or Male , Female, Unspecified.
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.
Like this
'other' => 'Translations',
'unsure' => 'Translations',
'trans-mtf' => 'Translation',
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