mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Изменения понятия "гендер" и "пол" на "местоимения" (#1033)
This commit is contained in:
parent
237206ccec
commit
5b8fe91a33
31 changed files with 1195 additions and 33 deletions
|
@ -62,7 +62,7 @@ final class Users extends VKAPIRequestHandler
|
|||
$response[$i]->verified = intval($usr->isVerified());
|
||||
break;
|
||||
case "sex":
|
||||
$response[$i]->sex = $usr->isFemale() ? 1 : 2;
|
||||
$response[$i]->sex = $usr->isFemale() ? 1 : ($usr->isNeutral() ? 0 : 2);
|
||||
break;
|
||||
case "has_photo":
|
||||
$response[$i]->has_photo = is_null($usr->getAvatarPhoto()) ? 0 : 1;
|
||||
|
|
|
@ -236,7 +236,7 @@ final class Wall extends VKAPIRequestHandler
|
|||
"last_name" => $user->getLastName(),
|
||||
"can_access_closed" => false,
|
||||
"is_closed" => false,
|
||||
"sex" => $user->isFemale() ? 1 : 2,
|
||||
"sex" => $user->isFemale() ? 1 : ($user->isNeutral() ? 0 : 2),
|
||||
"screen_name" => $user->getShortCode(),
|
||||
"photo_50" => $user->getAvatarUrl(),
|
||||
"photo_100" => $user->getAvatarUrl(),
|
||||
|
@ -441,7 +441,7 @@ final class Wall extends VKAPIRequestHandler
|
|||
"last_name" => $user->getLastName(),
|
||||
"can_access_closed" => false,
|
||||
"is_closed" => false,
|
||||
"sex" => $user->isFemale() ? 1 : 2,
|
||||
"sex" => $user->isFemale() ? 1 : ($user->isNeutral() ? 0 : 2),
|
||||
"screen_name" => $user->getShortCode(),
|
||||
"photo_50" => $user->getAvatarUrl(),
|
||||
"photo_100" => $user->getAvatarUrl(),
|
||||
|
|
|
@ -795,7 +795,29 @@ class User extends RowModel
|
|||
|
||||
function isFemale(): bool
|
||||
{
|
||||
return (bool) $this->getRecord()->sex;
|
||||
return $this->getRecord()->sex == 1;
|
||||
}
|
||||
|
||||
function isNeutral(): bool
|
||||
{
|
||||
return (bool) $this->getRecord()->sex == 2;
|
||||
}
|
||||
|
||||
function getLocalizedPronouns(): string
|
||||
{
|
||||
switch ($this->getRecord()->sex) {
|
||||
case 0:
|
||||
return tr('male');
|
||||
case 1:
|
||||
return tr('female');
|
||||
case 2:
|
||||
return tr('neutral');
|
||||
}
|
||||
}
|
||||
|
||||
function getPronouns(): int
|
||||
{
|
||||
return $this->getRecord()->sex;
|
||||
}
|
||||
|
||||
function isVerified(): bool
|
||||
|
|
|
@ -95,7 +95,17 @@ final class AuthPresenter extends OpenVKPresenter
|
|||
$user = new User;
|
||||
$user->setFirst_Name($this->postParam("first_name"));
|
||||
$user->setLast_Name($this->postParam("last_name"));
|
||||
$user->setSex((int)($this->postParam("sex") === "female"));
|
||||
switch ($this->postParam("pronouns")) {
|
||||
case 'male':
|
||||
$user->setSex(0);
|
||||
break;
|
||||
case 'female':
|
||||
$user->setSex(1);
|
||||
break;
|
||||
case 'neutral':
|
||||
$user->setSex(2);
|
||||
break;
|
||||
}
|
||||
$user->setEmail($this->postParam("email"));
|
||||
$user->setSince(date("Y-m-d H:i:s"));
|
||||
$user->setRegistering_Ip(CONNECTING_IP);
|
||||
|
|
|
@ -183,8 +183,18 @@ final class UserPresenter extends OpenVKPresenter
|
|||
if ($this->postParam("politViews") <= 9 && $this->postParam("politViews") >= 0)
|
||||
$user->setPolit_Views($this->postParam("politViews"));
|
||||
|
||||
if ($this->postParam("gender") <= 1 && $this->postParam("gender") >= 0)
|
||||
$user->setSex($this->postParam("gender"));
|
||||
if ($this->postParam("pronouns") <= 2 && $this->postParam("pronouns") >= 0)
|
||||
switch ($this->postParam("pronouns")) {
|
||||
case '0':
|
||||
$user->setSex(0);
|
||||
break;
|
||||
case '1':
|
||||
$user->setSex(1);
|
||||
break;
|
||||
case '2':
|
||||
$user->setSex(2);
|
||||
break;
|
||||
}
|
||||
$user->setAudio_broadcast_enabled($this->checkbox("broadcast_music"));
|
||||
|
||||
if(!empty($this->postParam("phone")) && $this->postParam("phone") !== $user->getPhone()) {
|
||||
|
|
|
@ -91,13 +91,13 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="regform-left">
|
||||
<span class="nobold">{_gender}: </span>
|
||||
<span class="nobold">{_pronouns}: </span>
|
||||
</td>
|
||||
<td class="regform-right">
|
||||
{var $femalePreferred = OPENVK_ROOT_CONF["openvk"]["preferences"]["femaleGenderPriority"]}
|
||||
<select name="sex" required>
|
||||
<option n:attr="selected => !$femalePreferred" value="male">{_male}</option>
|
||||
<option n:attr="selected => $femalePreferred" value="female">{_female}</option>
|
||||
<select name="pronouns" required>
|
||||
<option value="male">{_male}</option>
|
||||
<option value="female">{_female}</option>
|
||||
<option value="neutral">{_neutral}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
{/if}
|
||||
{if $x->getPrivacySetting("page.info.read") > 1}
|
||||
<tr>
|
||||
<td><span class="nobold">{_gender}: </span></td>
|
||||
<td>{$x->isFemale() ? tr("female") : tr("male")}</td>
|
||||
<td><span class="nobold">{_pronouns}: </span></td>
|
||||
<td>{$x->isFemale() ? tr("female") : ($x->isNeutral() ? tr("neutral") : tr("male"))}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="nobold">{_relationship}:</span></td>
|
||||
|
@ -308,14 +308,14 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="searchOption">
|
||||
<!-- <div class="searchOption">
|
||||
<div class="searchOptionName" id="n_gender" onclick="hideParams('gender')"><img src="/assets/packages/static/openvk/img/hide.png" class="searchHide">{_gender}</div>
|
||||
<div class="searchOptionBlock" id="s_gender">
|
||||
<p><input type="radio" form="searcher" id="gend" {if $_GET['gender'] == 0}checked{/if} name="gender" value="0">{_male}</p>
|
||||
<p><input type="radio" form="searcher" id="gend1"{if $_GET['gender'] == 1}checked{/if} name="gender" value="1">{_female}</p>
|
||||
<p><input type="radio" form="searcher" id="gend2"{if $_GET['gender'] == 2 || is_null($_GET['gender'])}checked{/if} name="gender" value="2">{_s_any}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="searchOption">
|
||||
<div class="searchOptionName" id="n_relationship" onclick="hideParams('relationship')"><img src="/assets/packages/static/openvk/img/hide.png" class="searchHide">{ovk_proc_strtr(tr("relationship"), 14)}</div>
|
||||
|
|
|
@ -139,12 +139,13 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_gender}: </span>
|
||||
<span class="nobold">{_pronouns}: </span>
|
||||
</td>
|
||||
<td>
|
||||
<select name="gender">
|
||||
<option value="1" {if $user->isFemale() == true}selected{/if}>{_female}</option>
|
||||
<option value="0" {if $user->isFemale() == false}selected{/if}>{_male}</option>
|
||||
<select name="pronouns">
|
||||
<option value="0" {if $user->getPronouns() == 0}selected{/if}>{_male}</option>
|
||||
<option value="1" {if $user->getPronouns() == 1}selected{/if}>{_female}</option>
|
||||
<option value="2" {if $user->getPronouns() == 2}selected{/if}>{_neutral}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -451,8 +451,8 @@
|
|||
<table id="basicInfo" class="ugc-table" border="0" cellspacing="0" cellpadding="0" border="0" cellspacing="0" cellpadding="0" n:if=" $user->getPrivacyPermission('page.info.read', $thisUser ?? NULL)">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label"><span class="nobold">{_gender}: </span></td>
|
||||
<td class="data">{$user->isFemale() ? tr("female") : tr("male")}</td>
|
||||
<td class="label"><span class="nobold">{_pronouns}: </span></td>
|
||||
<td class="data">{$user->isFemale() ? tr("female") : ($user->isNeutral() ? tr("neutral") : tr("male"))}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><span class="nobold">{_relationship}:</span></td>
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
<div class="post-author">
|
||||
<a href="{$author->getURL()}"><b class="post-author-name">{$author->getCanonicalName()}</b></a>
|
||||
<img n:if="$author->isVerified()" class="name-checkmark" src="/assets/packages/static/openvk/img/checkmark.png">
|
||||
{$post->isDeactivationMessage() ? ($author->isFemale() ? tr($deac . "_f") : tr($deac . "_m"))}
|
||||
{$post->isUpdateAvatarMessage() && !$post->isPostedOnBehalfOfGroup() ? ($author->isFemale() ? tr("upd_f") : tr("upd_m"))}
|
||||
{$post->isDeactivationMessage() ? ($author->isFemale() ? tr($deac . "_f") : ($author->isNeutral() ? tr($deac . "_g") : tr($deac . "_m")))}
|
||||
{$post->isUpdateAvatarMessage() && !$post->isPostedOnBehalfOfGroup() ? ($author->isFemale() ? tr("upd_f") : ($author->isNeutral() ? tr("upd_n") : tr("upd_m")))}
|
||||
{$post->isUpdateAvatarMessage() && $post->isPostedOnBehalfOfGroup() ? tr("upd_g") : ""}
|
||||
{if ($onWallOf ?? false) &&!$post->isPostedOnBehalfOfGroup() && $post->getOwnerPost() !== $post->getTargetWall()}
|
||||
{var $wallOwner = $post->getWallOwner()}
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
{else}
|
||||
{if $author->isFemale()}
|
||||
{_post_writes_f}
|
||||
{elseif $author->isNeutral()}
|
||||
{_post_writes_g}
|
||||
{else}
|
||||
{_post_writes_m}
|
||||
{/if}
|
||||
|
|
1107
Web/static/js/package-lock.json
generated
Normal file
1107
Web/static/js/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
0
locales/README.md
Normal file → Executable file
0
locales/README.md
Normal file → Executable file
0
locales/by.strings
Normal file → Executable file
0
locales/by.strings
Normal file → Executable file
0
locales/by_lat.strings
Normal file → Executable file
0
locales/by_lat.strings
Normal file → Executable file
0
locales/de.strings
Normal file → Executable file
0
locales/de.strings
Normal file → Executable file
|
@ -72,9 +72,10 @@
|
|||
"change_status" = "change status";
|
||||
"name" = "Name";
|
||||
"surname" = "Surname";
|
||||
"gender" = "Sex";
|
||||
"male" = "male";
|
||||
"female" = "female";
|
||||
"pronouns" = "Pronouns";
|
||||
"male" = "he/him";
|
||||
"female" = "she/her";
|
||||
"neutral" = "they/them";
|
||||
"description" = "Description";
|
||||
"save" = "Save";
|
||||
"main_information" = "Main information";
|
||||
|
@ -171,8 +172,10 @@
|
|||
"post_writes_g" = "published";
|
||||
"post_deact_m" = "deleted his profile saying:";
|
||||
"post_deact_f" = "deleted her profile saying:";
|
||||
"post_deact_g" = "deleted they profile saying:";
|
||||
"post_deact_silent_m" = "silently deleted his profile.";
|
||||
"post_deact_silent_f" = "silently deleted her profile.";
|
||||
"post_deact_silent_f" = "silently deleted they profile.";
|
||||
"post_on_your_wall" = "on your wall";
|
||||
"post_on_group_wall" = "in $1";
|
||||
"post_on_user_wall" = "on $1's wall";
|
||||
|
|
0
locales/eo.strings
Normal file → Executable file
0
locales/eo.strings
Normal file → Executable file
0
locales/hy.strings
Normal file → Executable file
0
locales/hy.strings
Normal file → Executable file
0
locales/id.strings
Normal file → Executable file
0
locales/id.strings
Normal file → Executable file
0
locales/kk.strings
Normal file → Executable file
0
locales/kk.strings
Normal file → Executable file
0
locales/pl.strings
Normal file → Executable file
0
locales/pl.strings
Normal file → Executable file
0
locales/qqx.strings
Normal file → Executable file
0
locales/qqx.strings
Normal file → Executable file
|
@ -62,9 +62,10 @@
|
|||
"change_status" = "изменить статус";
|
||||
"name" = "Имя";
|
||||
"surname" = "Фамилия";
|
||||
"gender" = "Пол";
|
||||
"male" = "мужской";
|
||||
"female" = "женский";
|
||||
"pronouns" = "Местоимения";
|
||||
"male" = "он/его";
|
||||
"female" = "она/её";
|
||||
"neutral" = "они/их";
|
||||
"description" = "Описание";
|
||||
"save" = "Сохранить";
|
||||
"main_information" = "Основная информация";
|
||||
|
@ -152,8 +153,10 @@
|
|||
"post_writes_g" = "опубликовали";
|
||||
"post_deact_m" = "удалил страницу со словами:";
|
||||
"post_deact_f" = "удалила страницу со словами:";
|
||||
"post_deact_g" = "удалили страницу со словами:";
|
||||
"post_deact_silent_m" = "молча удалил свою страницу.";
|
||||
"post_deact_silent_f" = "молча удалила свою страницу.";
|
||||
"post_deact_silent_g" = "молча удалили свою страницу.";
|
||||
"post_on_your_wall" = "на вашей стене";
|
||||
"post_on_group_wall" = "в $1";
|
||||
"post_on_user_wall" = "на стене $1";
|
||||
|
@ -446,6 +449,7 @@
|
|||
|
||||
"upd_m" = "обновил фотографию на своей странице";
|
||||
"upd_f" = "обновила фотографию на своей странице";
|
||||
"upd_n" = "обновили фотографию на своей странице";
|
||||
"upd_g" = "обновило фотографию группы";
|
||||
|
||||
"add_photos" = "Добавить фотографии";
|
||||
|
|
0
locales/ru_old.strings
Normal file → Executable file
0
locales/ru_old.strings
Normal file → Executable file
0
locales/ru_sov.strings
Normal file → Executable file
0
locales/ru_sov.strings
Normal file → Executable file
0
locales/sr_cyr.strings
Normal file → Executable file
0
locales/sr_cyr.strings
Normal file → Executable file
0
locales/sr_lat.strings
Normal file → Executable file
0
locales/sr_lat.strings
Normal file → Executable file
0
locales/tr.strings
Normal file → Executable file
0
locales/tr.strings
Normal file → Executable file
0
locales/udm.strings
Normal file → Executable file
0
locales/udm.strings
Normal file → Executable file
|
@ -64,9 +64,10 @@
|
|||
"change_status" = "змінити статус";
|
||||
"name" = "Ім’я";
|
||||
"surname" = "Прізвище";
|
||||
"gender" = "Стать";
|
||||
"male" = "Чоловіча";
|
||||
"female" = "Жіноча";
|
||||
"pronouns" = "Займенники";
|
||||
"male" = "він/його";
|
||||
"female" = "вона/її";
|
||||
"neutral" = "вони/їх";
|
||||
"description" = "Опис";
|
||||
"save" = "Зберегти";
|
||||
"main_information" = "Основна інформація";
|
||||
|
@ -147,8 +148,10 @@
|
|||
"post_writes_g" = "опублікували";
|
||||
"post_deact_m" = "видалив сторінку зі словами:";
|
||||
"post_deact_f" = "видалила сторінку зі словами:";
|
||||
"post_deact_g" = "видалили сторінку зі словами:";
|
||||
"post_deact_silent_m" = "мовчки видалив свою сторінку.";
|
||||
"post_deact_silent_f" = "мовчки видалила свою сторінку.";
|
||||
"post_deact_silent_g" = "мовчки видалили свою сторінку.";
|
||||
"post_on_your_wall" = "на вашій стіні";
|
||||
"post_on_group_wall" = "в $1";
|
||||
"post_on_user_wall" = "на стіні $1";
|
||||
|
|
Loading…
Reference in a new issue