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',
)
.
i will try, thanks
All translations strings need to be done via ossn_print()
You need to add translations in each file example ossn.de.php
https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/master/locale/ossn.de.php#LL40C1-L41C28
Example ossn.de.php for
ossn_register_languages('de', array(
'male' => 'männlich',
'female' => 'weiblich',
'other' => 'Other',
' fourthgender' => 'Forth Translation',
));
I mentioend this in my previous reply too, ossn.en.php
ossn_register_languages('en', array(
'weiblich' => 'Something',
'nonbinary' => 'Translation',
'other' => 'Other',
'unsure' => 'Unsure',
));
How exactly do i have to do it?
how is the ossn_print recognizing the langauge selected by user?
This component already support translation
'options' => array(
'male' => ossn_print('male'),
'female' => ossn_print('female'),
'other' => ossn_print('other')
'fourth_gender' => ossn_print('fourthgender')
)
I need help to implement locale file for translation
So you’ll fix the extended member component?
Or do I just have to add you code to the locale file from extended member?
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: