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
German Dominik L Replied 10 months ago

Can I somehow make the gender visible in profile?
Maybe beside the profile picture?

Maybe like this?

enter image description here

German Dominik L Replied 10 months ago

I really forgot the ossn_print, Arsalan already mentioned

Thank you!

German Michael Zülsdorff Replied 10 months ago

Yes, because ossn_print() is missing in your options array.

Each language file comes with one or more pairs of

'a_unique_identifier' =>  'a_translation',

For example

'gelb_und_blau_gemischt' => 'grün',

in ossn.de.php and

'gelb_und_blau_gemischt' => 'green',

in ossn.en.php

Simply pass that identifier to the ossn_print function like

ossn_print('gelb_und_blau_gemischt');

and depending on the chosen language (German or English) of the member, ossn_print will search for that identifier and automatically display the corresponding translation grün or green.

If there's no language file available for a chosen language then ossn_print would display the given identifier gelb_und_blau_gemischt

German Dominik L Replied 10 months ago

in the ossn_com.php from MoreGender I added this:

enter image description here

in ossn_en.php I added this:

enter image description here

but it is not translated:

enter image description here

German Dominik L Replied 11 months ago

i will try, thanks

Indonesian Arsalan Shah Replied 11 months ago

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',                                   
));
German Dominik L Replied 11 months ago

How exactly do i have to do it?

how is the ossn_print recognizing the langauge selected by user?

Indonesian Arsalan Shah Replied 11 months ago

This component already support translation

'options' => array(
 'male' => ossn_print('male'),
 'female' => ossn_print('female'),
 'other' => ossn_print('other') 
 'fourth_gender' => ossn_print('fourthgender')
 )
German Dominik L Replied 11 months ago

I need help to implement locale file for translation

German Dominik L Replied 1 year ago

So you’ll fix the extended member component?

Or do I just have to add you code to the locale file from extended member?

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