mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Localization Supplement
This commit is contained in:
parent
de778a283e
commit
fdc58c4185
9 changed files with 100 additions and 29 deletions
|
@ -112,12 +112,12 @@ final class UserPresenter extends OpenVKPresenter
|
|||
|
||||
if(!empty($this->postParam("phone")) && $this->postParam("phone") !== $user->getPhone()) {
|
||||
if(!OPENVK_ROOT_CONF["openvk"]["credentials"]["zadarma"]["enable"])
|
||||
$this->flashFail("err", "Ошибка сегментации", "котлетки");
|
||||
$this->flashFail("err", tr("error_segmentation"), "котлетки");
|
||||
|
||||
$code = $user->setPhoneWithVerification($this->postParam("phone"));
|
||||
|
||||
if(!Sms::send($this->postParam("phone"), "OPENVK | Your verification code is: $code"))
|
||||
$this->flashFail("err", "Ошибка сегментации", "котлетки: Remote err!");
|
||||
$this->flashFail("err", tr("error_segmentation"), "котлетки: Remote err!");
|
||||
}
|
||||
} elseif($_GET['act'] === "contacts") {
|
||||
$user->setEmail_Contact(empty($this->postParam("email_contact")) ? NULL : $this->postParam("email_contact"));
|
||||
|
@ -138,12 +138,12 @@ final class UserPresenter extends OpenVKPresenter
|
|||
$user->save();
|
||||
} catch(\PDOException $ex) {
|
||||
if($ex->getCode() == 23000)
|
||||
$this->flashFail("err", "Ошибка", "Данный короткий адрес уже занят.");
|
||||
$this->flashFail("err", tr("error"), tr("error_shorturl"));
|
||||
else
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
$this->flash("succ", "Изменения сохранены", "Новые данные появятся на вашей странице.");
|
||||
$this->flash("succ", tr("changes_saved"), tr("changes_saved_comment"));
|
||||
}
|
||||
|
||||
$this->template->mode = in_array($this->queryParam("act"), [
|
||||
|
@ -168,7 +168,7 @@ final class UserPresenter extends OpenVKPresenter
|
|||
if(!$user->verifyNumber($this->postParam("code") ?? 0))
|
||||
$this->flashFail("err", "Ошибка", "Не удалось подтвердить номер телефона: неверный код.");
|
||||
|
||||
$this->flash("succ", "Изменения сохранены", "Новые данные появятся на вашей странице.");
|
||||
$this->flash("succ", tr("changes_saved"), tr("changes_saved_comment"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,11 +201,11 @@ final class UserPresenter extends OpenVKPresenter
|
|||
$photo->save();
|
||||
} catch(ISE $ex) {
|
||||
$name = $album->getName();
|
||||
$this->flashFail("err", "Неизвестная ошибка", "Не удалось сохранить фотографию.");
|
||||
$this->flashFail("err", tr("error"), tr("error_upload_failed"));
|
||||
}
|
||||
|
||||
(new Albums)->getUserAvatarAlbum($this->user->identity)->addPhoto($photo);
|
||||
$this->flashFail("succ", "Фотография сохранена", "Новое изображения профиля появится у вас на странице.");
|
||||
$this->flashFail("succ", tr("photo_saved"), tr("photo_saved_comment"));
|
||||
}
|
||||
|
||||
function renderSettings(): void
|
||||
|
@ -223,14 +223,14 @@ final class UserPresenter extends OpenVKPresenter
|
|||
if($this->postParam("old_pass") && $this->postParam("new_pass") && $this->postParam("repeat_pass")) {
|
||||
if($this->postParam("new_pass") === $this->postParam("repeat_pass")) {
|
||||
if(!$this->user->identity->getChandlerUser()->updatePassword($this->postParam("new_pass"), $this->postParam("old_pass")))
|
||||
$this->flashFail("err", "Ошибка", "Старый пароль не совпадает.");
|
||||
$this->flashFail("err", tr("error"), tr("error_old_password"));
|
||||
} else {
|
||||
$this->flashFail("err", "Ошибка", "Новые пароли не совпадают.");
|
||||
$this->flashFail("err", tr("error"), tr("error_new_password"));
|
||||
}
|
||||
}
|
||||
|
||||
if(!$user->setShortCode(empty($this->postParam("sc")) ? NULL : $this->postParam("sc")))
|
||||
$this->flashFail("err", "Ошибка", "Короткий адрес имеет некорректный формат.");
|
||||
$this->flashFail("err", tr("error"), tr("error_shorturl_incorrect"));
|
||||
}elseif($_GET['act'] === "privacy") {
|
||||
$settings = [
|
||||
"page.read",
|
||||
|
@ -273,7 +273,7 @@ final class UserPresenter extends OpenVKPresenter
|
|||
$user->save();
|
||||
} catch(\PDOException $ex) {
|
||||
if($ex->getCode() == 23000)
|
||||
$this->flashFail("err", "Ошибка", "Данный короткий адрес уже занят.");
|
||||
$this->flashFail("err", tr("error"), tr("error_shorturl"));
|
||||
else
|
||||
throw $ex;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<td width="120" valign="top"><span class="nobold">{_"gender"}: </span></td>
|
||||
<td>{$x->isFemale() ? "женский" : "мужской"}</td>
|
||||
<td>{$x->isFemale() ? tr("female") : tr("male")}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top"><span class="nobold">{_"relationship"}:</span></td>
|
||||
|
|
|
@ -117,6 +117,7 @@
|
|||
</form>
|
||||
|
||||
<!-- dsrev: it's better if we hide it before the page deletion function appears tbh.
|
||||
vc: i agree
|
||||
|
||||
<div class="settings_delete">
|
||||
{_you_can_also} <a href="#" onclick="alert('Не реализовали ждите')">{_delete_your_page}</a>.
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
|
||||
{if !$user->getPrivacyPermission('page.read', $thisUser ?? NULL)}
|
||||
<div class="msg msg_err">
|
||||
<b>Ошибка доступа</b><br/>
|
||||
Настройки приватности этого пользователя не разрешают вам смотреть на его страницу.
|
||||
<b>{_forbidden}</b><br/>
|
||||
{_forbidden_comment}
|
||||
</div>
|
||||
{else}
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
<div>
|
||||
<a href="{$user->getAvatarLink()|nocheck}">
|
||||
<img src="{$user->getAvatarUrl()}"
|
||||
alt="Фотография пользователя {$user->getCanonicalName()}"
|
||||
alt="{$user->getCanonicalName()}"
|
||||
style="width: 100%; image-rendering: -webkit-optimize-contrast;" />
|
||||
</a>
|
||||
</div>
|
||||
|
@ -68,16 +68,16 @@
|
|||
{else}
|
||||
{if $thisUser->getChandlerUser()->can("substitute")->model('openvk\Web\Models\Entities\User')->whichBelongsTo(0)}
|
||||
<a href="/setSID/{$user->getChandlerUser()->getId()}?hash={rawurlencode($csrfToken)}" class="profile_link">
|
||||
Войти как {$user->getFirstName()}
|
||||
{tr("login_as", $user->getFirstName())}
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
{if $thisUser->getChandlerUser()->can("access")->model("admin")->whichBelongsTo(NULL)}
|
||||
<a href="javascript:banUser()" class="profile_link">
|
||||
Забанить пользователя
|
||||
{_ban_user_action}
|
||||
</a>
|
||||
<a href="javascript:warnUser()" class="profile_link">
|
||||
Предупредить пользователя
|
||||
{_warn_user_action}
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
|
@ -217,7 +217,7 @@
|
|||
</div>
|
||||
<div>
|
||||
<b><a href="/album{$album->getPrettyId()}">{$album->getName()}</a></b><br>
|
||||
<span class="nobold">Обновлён {$album->getEditTime() ?? $album->getPublicationTime()}</span>
|
||||
<span class="nobold">{tr("updated_at", $album->getEditTime() ?? $album->getPublicationTime())}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -436,7 +436,7 @@
|
|||
{if !empty($contactInfo_Tmp)}
|
||||
{$contactInfo_Tmp|noescape}
|
||||
{else}
|
||||
<div style="padding: 15px;color:gray;text-align: center;">Информация отсутствует.</div>
|
||||
<div style="padding: 15px;color:gray;text-align: center;">{_no_information_provided}</div>
|
||||
{/if}
|
||||
<br>
|
||||
{/if}
|
||||
|
@ -444,7 +444,7 @@
|
|||
{if !empty($uInfo_Tmp)}
|
||||
{$uInfo_Tmp|noescape}
|
||||
{else}
|
||||
<div style="padding-top: 15px;color:gray;text-align: center;">Информация отсутствует.</div>
|
||||
<div style="padding-top: 15px;color:gray;text-align: center;">{_no_information_provided}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
parent => $post }
|
||||
</div>
|
||||
<div style="float: left; min-height: 100px; width: 32%;">
|
||||
<h4>Действия</h4>
|
||||
<h4>{_actions}</h4>
|
||||
{if isset($thisUser)}
|
||||
{var canDelete = $post->canBeDeletedBy($thisUser)}
|
||||
{/if}
|
||||
|
||||
<a n:if="$canDelete ?? false" class="profile_link" style="display:block;width:96%;" href="/wall{$post->getPrettyId()}/delete">Удалить</a>
|
||||
<a class="profile_link" style="display:block;width:96%;" href="/report.pl/{$post->getId()}?type=post">Пожаловаться</a>
|
||||
<a n:if="$canDelete ?? false" class="profile_link" style="display:block;width:96%;" href="/wall{$post->getPrettyId()}/delete">{_delete}</a>
|
||||
<a class="profile_link" style="display:block;width:96%;" href="/report.pl/{$post->getId()}?type=post">{_report}</a>
|
||||
</div>
|
||||
{/block}
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<input type="submit" value="{_'write'}" class="button" />
|
||||
<div style="float: right;">
|
||||
<a href="javascript:void(document.querySelector(`input[name=_pic_attachment]`).click());">
|
||||
Прикрепить изображение
|
||||
{_attach_photo}
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -63,7 +63,7 @@
|
|||
{/foreach}
|
||||
{include "../components/paginator.xml", conf => $paginatorConf}
|
||||
{else}
|
||||
Здесь никто ничего не написал... Пока.
|
||||
{_no_posts_abstract}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<center>
|
||||
<a n:if="$conf->page != 1"
|
||||
href="?{http_build_query(array_merge($_GET, ['p' => ($conf->page - 1)]), 'k', '&', PHP_QUERY_RFC3986)}"
|
||||
style="float: left;"><< Назад</a>
|
||||
style="float: left;"><< {_paginator_back}</a>
|
||||
|
||||
Страница {$conf->page}
|
||||
{tr("paginator_page", $conf->page)}
|
||||
|
||||
<a n:if="$conf->count > (($conf->page - 1) * $conf->perPage + $conf->amount) && $conf->amount > 0"
|
||||
href="?{http_build_query(array_merge($_GET, ['p' => ($conf->page + 1)]), 'k', '&', PHP_QUERY_RFC3986)}"
|
||||
style="float: right;">Вперёд >></a>
|
||||
style="float: right;">{_paginator_next} >></a>
|
||||
</center>
|
||||
</div>
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
"all_title" = "All";
|
||||
"information" = "Information";
|
||||
"status" = "Status";
|
||||
"no_information_provided" = "No information provided.";
|
||||
|
||||
"relationship" = "Relationship";
|
||||
|
||||
|
@ -86,6 +87,8 @@
|
|||
"favorite_quotes" = "Favorite quotes";
|
||||
"information_about" = "About";
|
||||
|
||||
"updated_at" = "Updated at $1";
|
||||
|
||||
%{ Wall %}
|
||||
|
||||
"post_writes_m" = "wrote";
|
||||
|
@ -109,6 +112,9 @@
|
|||
"publish_post" = "Add post";
|
||||
|
||||
"nsfw_warning" = "This post may have NSFW-content";
|
||||
"report" = "Report";
|
||||
"attach_photo" = "Attach photo";
|
||||
"no_posts_abstract" = "Nobody wrote anything here... At least.";
|
||||
|
||||
%{ Friends %}
|
||||
|
||||
|
@ -374,3 +380,32 @@
|
|||
|
||||
"no_data" = "No data";
|
||||
"no_data_description" = "There is no data.";
|
||||
|
||||
"error" = "Error";
|
||||
"error_shorturl" = "This short address is already owned.";
|
||||
"error_segmentation" = "Segmentation error";
|
||||
"error_upload_failed" = "Failed to upload a photo";
|
||||
"error_old_password" = "Old password does not match";
|
||||
"error_new_password" = "New password does not match";
|
||||
"error_shorturl_incorrect" = "The short address has an incorrect format.";
|
||||
|
||||
"forbidden" = "Access error";
|
||||
"forbidden_comment" = "This user\'s privacy settings do not allow you to look at his page.";
|
||||
|
||||
"changes_saved" = "Changes saved";
|
||||
"changes_saved_comment" = "New data will appear on your page";
|
||||
|
||||
"photo_saved" = "Photo saved";
|
||||
"photo_saved_comment" = "New profile picture will appear on your page";
|
||||
|
||||
%{ Admin actions %}
|
||||
|
||||
"login_as" = "Login as $1";
|
||||
"ban_user_action" = "Ban user";
|
||||
"warn_user_action" = "Warn user";
|
||||
|
||||
%{ Paginator %}
|
||||
|
||||
"paginator_back" = "Back";
|
||||
"paginator_page" = "Page $1";
|
||||
"paginator_next" = "Next";
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"all_title" = "Все";
|
||||
"information" = "Информация";
|
||||
"status" = "Статус";
|
||||
"no_information_provided" = "Информация отсутствует.";
|
||||
|
||||
"relationship" = "Семейное положение";
|
||||
|
||||
|
@ -84,6 +85,8 @@
|
|||
"favorite_quotes" = "Любимые цитаты";
|
||||
"information_about" = "О себе";
|
||||
|
||||
"updated_at" = "Обновлено $1";
|
||||
|
||||
%{ Wall %}
|
||||
|
||||
"post_writes_m" = "написал";
|
||||
|
@ -108,6 +111,9 @@
|
|||
"wall_other" = "$1 записей";
|
||||
|
||||
"nsfw_warning" = "Данный пост может содержать 18+ контент";
|
||||
"report" = "Пожаловаться";
|
||||
"attach_photo" = "Прикрепить фото";
|
||||
"no_posts_abstract" = "Здесь никто ничего не написал... Пока.";
|
||||
|
||||
%{ Friends %}
|
||||
|
||||
|
@ -437,3 +443,32 @@
|
|||
|
||||
"no_data" = "Нет данных";
|
||||
"no_data_description" = "В этом представлении отсутствуют данные.";
|
||||
|
||||
"error" = "Ошибка";
|
||||
"error_shorturl" = "Данный короткий адрес уже занят.";
|
||||
"error_segmentation" = "Ошибка сегментации";
|
||||
"error_upload_failed" = "Не удалось загрузить фото";
|
||||
"error_old_password" = "Старый пароль не совпадает";
|
||||
"error_new_password" = "Новые пароли не совпадает";
|
||||
"error_shorturl_incorrect" = "Короткий адрес имеет некорректный формат.";
|
||||
|
||||
"forbidden" = "Ошибка доступа";
|
||||
"forbidden_comment" = "Настройки приватности этого пользователя не разрешают вам смотреть на его страницу.";
|
||||
|
||||
"changes_saved" = "Изменения сохранены";
|
||||
"changes_saved_comment" = "Новый данные появятся на вашей странице";
|
||||
|
||||
"photo_saved" = "Фотография сохранена";
|
||||
"photo_saved_comment" = "Новое изображние профиля появится у вас на странице";
|
||||
|
||||
%{ Admin actions %}
|
||||
|
||||
"login_as" = "Войти как $1";
|
||||
"ban_user_action" = "Забанить пользователя";
|
||||
"warn_user_action" = "Предупредить пользователя";
|
||||
|
||||
%{ Paginator %}
|
||||
|
||||
"paginator_back" = "Назад";
|
||||
"paginator_page" = "Страница $1";
|
||||
"paginator_next" = "Дальше";
|
||||
|
|
Loading…
Reference in a new issue