Mark string translatable in View logs

and update messages.po
This commit is contained in:
fabrixxm 2021-10-01 16:45:34 +02:00
parent 5bcc6cca75
commit 0638e23f7a
4 changed files with 123 additions and 44 deletions

View file

@ -25,7 +25,6 @@ use Friendica\DI;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Theme; use Friendica\Core\Theme;
use Friendica\Module\BaseAdmin; use Friendica\Module\BaseAdmin;
use Friendica\Model\Log\ParsedLogIterator;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
class View extends BaseAdmin class View extends BaseAdmin
@ -81,13 +80,35 @@ class View extends BaseAdmin
} }
} }
return Renderer::replaceMacros($t, [ return Renderer::replaceMacros($t, [
'$title' => DI::l10n()->t('Administration'), '$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('View Logs'), '$page' => DI::l10n()->t('View Logs'),
'$l10n' => [
'Search' => DI::l10n()->t('Search'),
'Search_in_logs' => DI::l10n()->t('Search in logs'),
'Show_all' => DI::l10n()->t('Show all'),
'Date' => DI::l10n()->t('Date'),
'Level' => DI::l10n()->t('Level'),
'Context' => DI::l10n()->t('Context'),
'Message' => DI::l10n()->t('Message'),
'ALL' => DI::l10n()->t('ALL'),
'View_details' => DI::l10n()->t('View details'),
'Click_to_view_details' => DI::l10n()->t('Click to view details'),
'Event_details' => DI::l10n()->t('Event details'),
'Data' => DI::l10n()->t('Data'),
'Source' => DI::l10n()->t('Source'),
'File' => DI::l10n()->t('File'),
'Line' => DI::l10n()->t('Line'),
'Function' => DI::l10n()->t('Function'),
'UID' => DI::l10n()->t('UID'),
'Process_ID' => DI::l10n()->t('Process ID'),
'Close' => DI::l10n()->t('Close'),
],
'$data' => $data, '$data' => $data,
'$q' => $search, '$q' => $search,
'$filters' => $filters, '$filters' => $filters,
'$filtersvalues' => $filters_valid_values, '$filtersvalues' => $filters_valid_values,
'$error' => $error, '$error' => $error,
'$baseurl' => DI::baseUrl()->get(true),
'$logname' => DI::config()->get('system', 'logfile'), '$logname' => DI::config()->get('system', 'logfile'),
]); ]);
} }

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2021.12-dev\n" "Project-Id-Version: 2021.12-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-01 13:53+0200\n" "POT-Creation-Date: 2021-10-01 16:40+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -559,6 +559,7 @@ msgstr ""
#: mod/editpost.php:134 src/Content/Conversation.php:380 #: mod/editpost.php:134 src/Content/Conversation.php:380
#: src/Content/Widget/VCard.php:107 src/Model/Profile.php:459 #: src/Content/Widget/VCard.php:107 src/Model/Profile.php:459
#: src/Module/Admin/Logs/View.php:93
msgid "Message" msgid "Message"
msgstr "" msgstr ""
@ -588,7 +589,7 @@ msgstr ""
msgid "Create New Event" msgid "Create New Event"
msgstr "" msgstr ""
#: mod/events.php:536 #: mod/events.php:536 src/Module/Admin/Logs/View.php:97
msgid "Event details" msgid "Event details"
msgstr "" msgstr ""
@ -3165,7 +3166,7 @@ msgid "Addon applications, utilities, games"
msgstr "" msgstr ""
#: src/Content/Nav.php:230 src/Content/Text/HTML.php:891 #: src/Content/Nav.php:230 src/Content/Text/HTML.php:891
#: src/Module/Search/Index.php:99 #: src/Module/Admin/Logs/View.php:87 src/Module/Search/Index.php:99
msgid "Search" msgid "Search"
msgstr "" msgstr ""
@ -5483,7 +5484,7 @@ msgstr ""
msgid "Implicit Mention" msgid "Implicit Mention"
msgstr "" msgstr ""
#: src/Module/Admin/Item/Source.php:73 #: src/Module/Admin/Item/Source.php:73 src/Module/Admin/Logs/View.php:99
#: src/Module/Debug/ActivityPubConversion.php:62 #: src/Module/Debug/ActivityPubConversion.php:62
msgid "Source" msgid "Source"
msgstr "" msgstr ""
@ -5559,6 +5560,67 @@ msgstr ""
msgid "View Logs" msgid "View Logs"
msgstr "" msgstr ""
#: src/Module/Admin/Logs/View.php:88
msgid "Search in logs"
msgstr ""
#: src/Module/Admin/Logs/View.php:89
#: src/Module/Notifications/Notifications.php:138
msgid "Show all"
msgstr ""
#: src/Module/Admin/Logs/View.php:90
msgid "Date"
msgstr ""
#: src/Module/Admin/Logs/View.php:91
msgid "Level"
msgstr ""
#: src/Module/Admin/Logs/View.php:92
msgid "Context"
msgstr ""
#: src/Module/Admin/Logs/View.php:94
msgid "ALL"
msgstr ""
#: src/Module/Admin/Logs/View.php:95
msgid "View details"
msgstr ""
#: src/Module/Admin/Logs/View.php:96
msgid "Click to view details"
msgstr ""
#: src/Module/Admin/Logs/View.php:98
msgid "Data"
msgstr ""
#: src/Module/Admin/Logs/View.php:100
msgid "File"
msgstr ""
#: src/Module/Admin/Logs/View.php:101
msgid "Line"
msgstr ""
#: src/Module/Admin/Logs/View.php:102
msgid "Function"
msgstr ""
#: src/Module/Admin/Logs/View.php:103
msgid "UID"
msgstr ""
#: src/Module/Admin/Logs/View.php:104
msgid "Process ID"
msgstr ""
#: src/Module/Admin/Logs/View.php:105
msgid "Close"
msgstr ""
#: src/Module/Admin/Queue.php:50 #: src/Module/Admin/Queue.php:50
msgid "Inspect Deferred Worker Queue" msgid "Inspect Deferred Worker Queue"
msgstr "" msgstr ""
@ -8693,10 +8755,6 @@ msgstr ""
msgid "Show unread" msgid "Show unread"
msgstr "" msgstr ""
#: src/Module/Notifications/Notifications.php:138
msgid "Show all"
msgstr ""
#: src/Module/OAuth/Acknowledge.php:44 #: src/Module/OAuth/Acknowledge.php:44
msgid "Authorize application connection" msgid "Authorize application connection"
msgstr "" msgstr ""

View file

@ -9,16 +9,16 @@
{{else}} {{else}}
<form> <form>
<p> <p>
<input type="search" name="q" value="{{$q}}" placeholder="search"></input> <input type="search" name="q" value="{{$q}}" placeholder="{{$l10n.Search}}"></input>
<input type="Submit" value="search"> <input type="submit" value="{{$l10n.Search}}">
<a href="/admin/logs/view">clear</a> <a href="/admin/logs/view">{{$l10n.Show_all}}</a>
</p> </p>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>{{$l10n.Date}}</th>
<th> <th>
<select name="level" onchange="this.form.submit()"> <select name="level" onchange="this.form.submit()">
{{foreach $filtersvalues.level as $v }} {{foreach $filtersvalues.level as $v }}
@ -39,22 +39,22 @@
{{/foreach}} {{/foreach}}
</select> </select>
</th> </th>
<th>Message</th> <th>{{$l10n.Message}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{foreach $data as $row}} {{foreach $data as $row}}
<tr id="ev-{{$row->id}}" class="log-event" <tr id="ev-{{$row->id}}" class="log-event"
role="button" tabIndex="0" role="button" tabIndex="0"
aria-label="View details" aria-haspopup="true" aria-expanded="false" aria-label="{{$l10n.View_details}}" aria-haspopup="true" aria-expanded="false"
style="cursor:pointer;" style="cursor:pointer;"
title="Click to view details"> title="{{$l10n.Click_to_view_details}}">
<td>{{$row->date}}</td> <td>{{$row->date}}</td>
<td>{{$row->level}}</td> <td>{{$row->level}}</td>
<td>{{$row->context}}</td> <td>{{$row->context}}</td>
<td>{{$row->message}}</td> <td>{{$row->message}}</td>
</tr> </tr>
<tr class="hidden" data-id="ev-{{$row->id}}"><th colspan="4">Data</th></tr> <tr class="hidden" data-id="ev-{{$row->id}}"><th colspan="4">{{$l10n.Event_details}}</th></tr>
{{foreach $row->getData() as $k=>$v}} {{foreach $row->getData() as $k=>$v}}
<tr class="hidden" data-id="ev-{{$row->id}}"> <tr class="hidden" data-id="ev-{{$row->id}}">
<th>{{$k}}</th> <th>{{$k}}</th>
@ -63,7 +63,7 @@
</td> </td>
</tr> </tr>
{{/foreach}} {{/foreach}}
<tr class="hidden" data-id="ev-{{$row->id}}"><th colspan="4">Source</th></tr> <tr class="hidden" data-id="ev-{{$row->id}}"><th colspan="4">{{$l10n.Source}}</th></tr>
{{foreach $row->getSource() as $k=>$v}} {{foreach $row->getSource() as $k=>$v}}
<tr class="hidden" data-id="ev-{{$row->id}}"> <tr class="hidden" data-id="ev-{{$row->id}}">
<th>{{$k}}</th> <th>{{$k}}</th>

View file

@ -8,33 +8,33 @@
</div> </div>
{{else}} {{else}}
<form method="get" class="row"> <form method="get" class="row">
<div class="col-xs-10"> <div class="col-xs-8">
<div class="form-group form-group-search"> <div class="form-group form-group-search">
<input accesskey="s" id="nav-search-input-field" class="form-control form-search" <input accesskey="s" id="nav-search-input-field" class="form-control form-search"
type="text" name="q" data-toggle="tooltip" title="Search in logs" type="text" name="q" data-toggle="tooltip" title="{{$l10n.Search_in_logs}}"
placeholder="Search" value="{{$q}}"> placeholder="{{$l10n.Search}}" value="{{$q}}">
<button class="btn btn-default btn-sm form-button-search" <button class="btn btn-default btn-sm form-button-search"
type="submit">Search</button> type="submit">{{$l10n.Search}}</button>
</div> </div>
</div> </div>
<div class="xol-xs-2"> <div class="xol-xs-4">
<a href="/admin/logs/view" class="btn btn-default">Show all</a> <a href="/admin/logs/view" class="btn btn-default">{{$l10n.Show_all}}</a>
</div> </div>
</form> </form>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>{{$l10n.Date}}</th>
<th class="dropdown"> <th class="dropdown">
<a class="dropdown-toggle text-nowrap" type="button" id="level" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="dropdown-toggle text-nowrap" type="button" id="level" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Level {{if $filters.level}}({{$filters.level}}){{/if}}<span class="caret"></span> {{$l10n.Level}} {{if $filters.level}}({{$filters.level}}){{/if}}<span class="caret"></span>
</a> </a>
<ul class="dropdown-menu" aria-labelledby="level"> <ul class="dropdown-menu" aria-labelledby="level">
{{foreach $filtersvalues.level as $v }} {{foreach $filtersvalues.level as $v }}
<li {{if $filters.level == $v}}class="active"{{/if}}> <li {{if $filters.level == $v}}class="active"{{/if}}>
<a href="/admin/logs/view?level={{$v}}" data-filter="level" data-filter-value="{{$v}}"> <a href="/admin/logs/view?level={{$v}}" data-filter="level" data-filter-value="{{$v}}">
{{if $v == ""}}ALL{{/if}}{{$v}} {{if $v == ""}}{{$l10n.ALL}}{{/if}}{{$v}}
</a> </a>
</li> </li>
{{/foreach}} {{/foreach}}
@ -42,26 +42,26 @@
</th> </th>
<th class="dropdown"> <th class="dropdown">
<a class="dropdown-toggle text-nowrap" type="button" id="context" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="dropdown-toggle text-nowrap" type="button" id="context" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Context {{if $filters.context}}({{$filters.context}}){{/if}}<span class="caret"></span> {{$l10n.Context}} {{if $filters.context}}({{$filters.context}}){{/if}}<span class="caret"></span>
</a> </a>
<ul class="dropdown-menu" aria-labelledby="context"> <ul class="dropdown-menu" aria-labelledby="context">
{{foreach $filtersvalues.context as $v }} {{foreach $filtersvalues.context as $v }}
<li {{if $filters.context == $v}}class="active"{{/if}}> <li {{if $filters.context == $v}}class="active"{{/if}}>
<a href="/admin/logs/view?context={{$v}}" data-filter="context" data-filter-value="{{$v}}"> <a href="/admin/logs/view?context={{$v}}" data-filter="context" data-filter-value="{{$v}}">
{{if $v == ""}}ALL{{/if}}{{$v}} {{if $v == ""}}{{$l10n.ALL}}{{/if}}{{$v}}
</a> </a>
</li> </li>
{{/foreach}} {{/foreach}}
</ul> </ul>
</th> </th>
<th>Message</th> <th>{{$l10n.Message}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{foreach $data as $row}} {{foreach $data as $row}}
<tr id="ev-{{$row->id}}" class="log-event" <tr id="ev-{{$row->id}}" class="log-event"
role="button" tabIndex="0" role="button" tabIndex="0"
aria-label="View details" aria-haspopup="true" aria-expanded="false" aria-label="{{$l10n.View_details}}" aria-haspopup="true" aria-expanded="false"
data-data="{{$row->data}}" data-source="{{$row->source}}"> data-data="{{$row->data}}" data-source="{{$row->source}}">
<td>{{$row->date}}</td> <td>{{$row->date}}</td>
<td class=" <td class="
@ -86,16 +86,16 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Event details</h4> <h4 class="modal-title">{{$l10n.Event_details}}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<table class="table main-data"> <table class="table main-data">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>{{$l10n.Date}}</th>
<th>Level</th> <th>{{$l10n.Level}}</th>
<th>Context</th> <th>{{$l10n.Context}}</th>
<th>Message</th> <th>{{$l10n.Message}}</th>
</tr> </tr>
</thead> </thead>
<tbody><tr></tr></tbody> <tbody><tr></tr></tbody>
@ -103,11 +103,11 @@
<table class="table source-data"> <table class="table source-data">
<thead> <thead>
<tr> <tr>
<th>File</th> <th>{{$l10n.File}}</th>
<th>Line</th> <th>{{$l10n.Line}}</th>
<th>Function</th> <th>{{$l10n.Function}}</th>
<th>UID</th> <th>{{$l10n.UID}}</th>
<th>Process ID</th> <th>{{$l10n.Process_ID}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -131,7 +131,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-previous>&lt;</button> <button type="button" class="btn btn-default" data-previous>&lt;</button>
<button type="button" class="btn btn-default" data-next>&gt;</button> <button type="button" class="btn btn-default" data-next>&gt;</button>
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary" data-dismiss="modal">{{$l10n.Close}}</button>
</div> </div>
</div><!-- /.modal-content --> </div><!-- /.modal-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->