Issue 9743: Added translatable texts

This commit is contained in:
Michael 2021-03-08 21:17:27 +00:00
parent f6873cc912
commit 972c9f7bc0
10 changed files with 148 additions and 124 deletions

View file

@ -54,11 +54,23 @@ class Source extends BaseAdmin
$tpl = Renderer::getMarkupTemplate('admin/item/source.tpl');
$o = Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Item Source'),
'$guid' => ['guid', DI::l10n()->t('Item Guid'), $guid, ''],
'$source' => $source,
'$item_uri' => $item_uri,
'$item_id' => $item_id,
'$terms' => $terms,
'$itemidlbl' => DI::l10n()->t('Item Id'),
'$itemurilbl' => DI::l10n()->t('Item URI'),
'$submit' => DI::l10n()->t('Submit'),
'$termslbl' => DI::l10n()->t('Terms'),
'$taglbl' => DI::l10n()->t('Tag'),
'$typelbl' => DI::l10n()->t('Type'),
'$termlbl' => DI::l10n()->t('Term'),
'$urllbl' => DI::l10n()->t('URL'),
'$mentionlbl' => DI::l10n()->t('Mention'),
'$implicitlbl' => DI::l10n()->t('Implicit Mention'),
'$sourcelbl' => DI::l10n()->t('Source'),
]);
return $o;

View file

@ -135,8 +135,10 @@ class ActivityPubConversion extends BaseModule
$tpl = Renderer::getMarkupTemplate('debug/activitypubconversion.tpl');
$o = Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('ActivityPub Conversion'),
'$source' => ['source', DI::l10n()->t('Source activity'), $_REQUEST['source'] ?? '', ''],
'$results' => $results
'$results' => $results,
'$submit' => DI::l10n()->t('Submit'),
]);
return $o;

View file

@ -24,13 +24,10 @@ namespace Friendica\Module\Debug;
use Friendica\BaseModule;
use Friendica\Content\PageInfo;
use Friendica\Content\Text;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\Conversation;
use Friendica\Model\Item;
use Friendica\Protocol\Activity;
use Friendica\Model\Tag;
use Friendica\Util\XML;
/**
@ -306,6 +303,7 @@ class Babel extends BaseModule
$tpl = Renderer::getMarkupTemplate('babel.tpl');
$o = Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Babel Diagnostic'),
'$text' => ['text', DI::l10n()->t('Source text'), $_REQUEST['text'] ?? '', ''],
'$type_bbcode' => ['type', DI::l10n()->t('BBCode'), 'bbcode', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'bbcode'],
'$type_diaspora' => ['type', DI::l10n()->t('Diaspora'), 'diaspora', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'diaspora'],
@ -313,7 +311,8 @@ class Babel extends BaseModule
'$type_html' => ['type', DI::l10n()->t('HTML'), 'html', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'html'],
'$flag_twitter' => file_exists('addon/twitter/twitter.php'),
'$type_twitter' => ['type', DI::l10n()->t('Twitter Source / Tweet URL (requires API key)'), 'twitter', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'twitter'],
'$results' => $results
'$results' => $results,
'$submit' => DI::l10n()->t('Submit'),
]);
return $o;

View file

@ -50,6 +50,9 @@ class Probe extends BaseModule
$tpl = Renderer::getMarkupTemplate('probe.tpl');
return Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Probe Diagnostic'),
'$output' => DI::l10n()->t('Output'),
'$submit' => DI::l10n()->t('Submit'),
'$addr' => ['addr',
DI::l10n()->t('Lookup address'),
$addr,

View file

@ -49,6 +49,9 @@ class WebFinger extends BaseModule
$tpl = Renderer::getMarkupTemplate('webfinger.tpl');
return Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Webfinger Diagnostic'),
'$submit' => DI::l10n()->t('Submit'),
'$lookup' => DI::l10n()->t('Lookup address:'),
'$addr' => $addr,
'$res' => $res,
]);

View file

@ -1,18 +1,19 @@
<h2>Item Source</h2>
<form action="admin/item/source" method="get" class="panel panel-default">
<div id="source" class="generic-page-wrapper">
<h2>{{$title}}</h2>
<form action="admin/item/source" method="get" class="panel panel-default">
<div class="panel-body">
<div class="form-group">
{{include file="field_input.tpl" field=$guid}}
</div>
<p><button type="submit" class="btn btn-primary">Submit</button></p>
<p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
</div>
</form>
</form>
{{if $source}}
<div class="itemsource-results">
{{if $source}}
<div class="itemsource-results">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Item Id</h3>
<h3 class="panel-title">{{$itemidlbl}}</h3>
</div>
<div class="panel-body">
{{$item_id}}
@ -20,7 +21,7 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Item URI</h3>
<h3 class="panel-title">{{$itemurilbl}}</h3>
</div>
<div class="panel-body">
{{$item_uri}}
@ -28,21 +29,21 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Terms</h3>
<h3 class="panel-title">{{$termslbl}}</h3>
</div>
<div class="panel-body">
<table class="table table-condensed table-striped">
<tr>
<th>Type</th>
<th>Term</th>
<th>URL</th>
<th>{{$typelbl}}</th>
<th>{{$termlbl}}</th>
<th>{{$urllbl}}</th>
</tr>
{{foreach $terms as $term}}
<tr>
<td>
{{if $term.type == 1}}Tag{{/if}}
{{if $term.type == 2}}Mention{{/if}}
{{if $term.type == 8}}Implicit Mention{{/if}}
{{if $term.type == 1}}{{$tag}}{{/if}}
{{if $term.type == 2}}{{$mentionlbl}}{{/if}}
{{if $term.type == 8}}{{$implicitlbl}}{{/if}}
</td>
<td>
{{$term.name}}
@ -57,9 +58,10 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Source</h3>
<h3 class="panel-title">{{$sourcelbl}}</h3>
</div>
<pre><code class="language-php">{{$source}}</code></pre>
</div>
</div>
</div>
{{/if}}

View file

@ -1,5 +1,6 @@
<h2>Babel Diagnostic</h2>
<form action="babel" method="post" class="panel panel-default">
<div id="babel" class="generic-page-wrapper">
<h2>{{$title}}</h2>
<form action="babel" method="post" class="panel panel-default">
<div class="panel-body">
<div class="form-group">
{{include file="field_textarea.tpl" field=$text}}
@ -13,12 +14,12 @@
{{include file="field_radio.tpl" field=$type_twitter}}
{{/if}}
</div>
<p><button type="submit" class="btn btn-primary">Submit</button></p>
<p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
</div>
</form>
</form>
{{if $results}}
<div class="babel-results">
{{if $results}}
<div class="babel-results">
{{foreach $results as $result}}
<div class="panel panel-default">
<div class="panel-heading">
@ -27,5 +28,6 @@
<div class="panel-body">{{$result.content nofilter}}</div>
</div>
{{/foreach}}
</div>
</div>
{{/if}}

View file

@ -1,15 +1,16 @@
<h2>ActivityPub Conversion</h2>
<form action="debug/ap" method="post" class="panel panel-default">
<div id="apconversion" class="generic-page-wrapper">
<h2>{{$title}}</h2>
<form action="debug/ap" method="post" class="panel panel-default">
<div class="panel-body">
<div class="form-group">
{{include file="field_textarea.tpl" field=$source}}
</div>
<p><button type="submit" class="btn btn-primary">Submit</button></p>
<p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
</div>
</form>
</form>
{{if $results}}
<div class="babel-results">
{{if $results}}
<div class="babel-results">
{{foreach $results as $result}}
<div class="panel panel-default">
<div class="panel-heading">
@ -20,5 +21,6 @@
</div>
</div>
{{/foreach}}
</div>
{{/if}}
</div>
{{/if}}

View file

@ -1,11 +1,11 @@
<div id="probe" class="generic-page-wrapper">
<h2>Probe Diagnostic</h2>
<h2>{{$title}}</h2>
<form action="probe" method="get" class="panel panel-default">
<div class="panel-body">
<div class="form-group">
{{include file="field_input.tpl" field=$addr}}
</div>
<p><button type="submit" class="btn btn-primary">Submit</button></p>
<p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
</div>
</form>
@ -13,7 +13,7 @@
<div class="probe-result">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Output</h3>
<h3 class="panel-title">{{$output}}</h3>
</div>
<div class="panel-body">
<pre>{{$res}}</pre>

View file

@ -1,9 +1,8 @@
<div class="generic-page-wrapper">
<h3>Webfinger Diagnostic</h3>
<h2>{{$title}}</h2>
<form action="webfinger" method="get">
Lookup address: <input type="text" style="width: 250px;" name="addr" value="{{$addr}}" />
<input type="submit" name="submit" value="Submit" />
{{$lookup}} <input type="text" style="width: 250px;" name="addr" value="{{$addr}}" />
<input type="submit" name="submit" value="{{$submit}}" />
</form>
<br /><br />