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'); $tpl = Renderer::getMarkupTemplate('admin/item/source.tpl');
$o = Renderer::replaceMacros($tpl, [ $o = Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Item Source'),
'$guid' => ['guid', DI::l10n()->t('Item Guid'), $guid, ''], '$guid' => ['guid', DI::l10n()->t('Item Guid'), $guid, ''],
'$source' => $source, '$source' => $source,
'$item_uri' => $item_uri, '$item_uri' => $item_uri,
'$item_id' => $item_id, '$item_id' => $item_id,
'$terms' => $terms, '$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; return $o;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,5 @@
<h2>Babel Diagnostic</h2> <div id="babel" class="generic-page-wrapper">
<h2>{{$title}}</h2>
<form action="babel" method="post" class="panel panel-default"> <form action="babel" method="post" class="panel panel-default">
<div class="panel-body"> <div class="panel-body">
<div class="form-group"> <div class="form-group">
@ -13,7 +14,7 @@
{{include file="field_radio.tpl" field=$type_twitter}} {{include file="field_radio.tpl" field=$type_twitter}}
{{/if}} {{/if}}
</div> </div>
<p><button type="submit" class="btn btn-primary">Submit</button></p> <p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
</div> </div>
</form> </form>
@ -28,4 +29,5 @@
</div> </div>
{{/foreach}} {{/foreach}}
</div> </div>
</div>
{{/if}} {{/if}}

View file

@ -1,10 +1,11 @@
<h2>ActivityPub Conversion</h2> <div id="apconversion" class="generic-page-wrapper">
<h2>{{$title}}</h2>
<form action="debug/ap" method="post" class="panel panel-default"> <form action="debug/ap" method="post" class="panel panel-default">
<div class="panel-body"> <div class="panel-body">
<div class="form-group"> <div class="form-group">
{{include file="field_textarea.tpl" field=$source}} {{include file="field_textarea.tpl" field=$source}}
</div> </div>
<p><button type="submit" class="btn btn-primary">Submit</button></p> <p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
</div> </div>
</form> </form>
@ -22,3 +23,4 @@
{{/foreach}} {{/foreach}}
</div> </div>
{{/if}} {{/if}}
</div>

View file

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

View file

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