Merge pull request #10011 from annando/issue-9743

Issue 9743: Added translatable texts
This commit is contained in:
Hypolite Petovan 2021-03-08 18:42:51 -05:00 committed by GitHub
commit 4860dd1a6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 6231 additions and 6150 deletions

View file

@ -54,11 +54,23 @@ class Source extends BaseAdmin
$tpl = Renderer::getMarkupTemplate('admin/item/source.tpl');
$o = Renderer::replaceMacros($tpl, [
'$guid' => ['guid', DI::l10n()->t('Item Guid'), $guid, ''],
'$source' => $source,
'$item_uri' => $item_uri,
'$item_id' => $item_id,
'$terms' => $terms,
'$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, [
'$source' => ['source', DI::l10n()->t('Source activity'), $_REQUEST['source'] ?? '', ''],
'$results' => $results
'$title' => DI::l10n()->t('ActivityPub Conversion'),
'$source' => ['source', DI::l10n()->t('Source activity'), $_REQUEST['source'] ?? '', ''],
'$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,13 +50,16 @@ class Probe extends BaseModule
$tpl = Renderer::getMarkupTemplate('probe.tpl');
return Renderer::replaceMacros($tpl, [
'$addr' => ['addr',
'$title' => DI::l10n()->t('Probe Diagnostic'),
'$output' => DI::l10n()->t('Output'),
'$submit' => DI::l10n()->t('Submit'),
'$addr' => ['addr',
DI::l10n()->t('Lookup address'),
$addr,
'',
DI::l10n()->t('Required')
],
'$res' => $res,
'$res' => $res,
]);
}
}

View file

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

File diff suppressed because it is too large Load diff

View file

@ -1,65 +1,67 @@
<h2>Item Source</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 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>
</div>
<p><button type="submit" class="btn btn-primary">Submit</button></p>
</div>
</form>
</form>
{{if $source}}
<div class="itemsource-results">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Item Id</h3>
{{if $source}}
<div class="itemsource-results">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{$itemidlbl}}</h3>
</div>
<div class="panel-body">
{{$item_id}}
</div>
</div>
<div class="panel-body">
{{$item_id}}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{$itemurilbl}}</h3>
</div>
<div class="panel-body">
{{$item_uri}}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Item URI</h3>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{$termslbl}}</h3>
</div>
<div class="panel-body">
<table class="table table-condensed table-striped">
<tr>
<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}}{{$mentionlbl}}{{/if}}
{{if $term.type == 8}}{{$implicitlbl}}{{/if}}
</td>
<td>
{{$term.name}}
</td>
<td>
{{$term.url}}
</td>
</tr>
{{/foreach}}
</table>
</div>
</div>
<div class="panel-body">
{{$item_uri}}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{$sourcelbl}}</h3>
</div>
<pre><code class="language-php">{{$source}}</code></pre>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Terms</h3>
</div>
<div class="panel-body">
<table class="table table-condensed table-striped">
<tr>
<th>Type</th>
<th>Term</th>
<th>URL</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}}
</td>
<td>
{{$term.name}}
</td>
<td>
{{$term.url}}
</td>
</tr>
{{/foreach}}
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Source</h3>
</div>
<pre><code class="language-php">{{$source}}</code></pre>
</div>
</div>
{{/if}}

View file

@ -1,31 +1,33 @@
<h2>Babel Diagnostic</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}}
<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}}
</div>
<div class="form-group">
{{include file="field_radio.tpl" field=$type_bbcode}}
{{include file="field_radio.tpl" field=$type_diaspora}}
{{include file="field_radio.tpl" field=$type_markdown}}
{{include file="field_radio.tpl" field=$type_html}}
{{if $flag_twitter}}
{{include file="field_radio.tpl" field=$type_twitter}}
{{/if}}
</div>
<p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
</div>
<div class="form-group">
{{include file="field_radio.tpl" field=$type_bbcode}}
{{include file="field_radio.tpl" field=$type_diaspora}}
{{include file="field_radio.tpl" field=$type_markdown}}
{{include file="field_radio.tpl" field=$type_html}}
{{if $flag_twitter}}
{{include file="field_radio.tpl" field=$type_twitter}}
{{/if}}
</div>
<p><button type="submit" class="btn btn-primary">Submit</button></p>
</div>
</form>
</form>
{{if $results}}
<div class="babel-results">
{{foreach $results as $result}}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{$result.title}}</h3>
{{if $results}}
<div class="babel-results">
{{foreach $results as $result}}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{$result.title}}</h3>
</div>
<div class="panel-body">{{$result.content nofilter}}</div>
</div>
<div class="panel-body">{{$result.content nofilter}}</div>
{{/foreach}}
</div>
{{/foreach}}
</div>
{{/if}}

View file

@ -1,24 +1,26 @@
<h2>ActivityPub Conversion</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>
</div>
</form>
{{if $results}}
<div class="babel-results">
{{foreach $results as $result}}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{$result.title}}</h3>
</div>
<div id="apconversion" class="generic-page-wrapper">
<h2>{{$title}}</h2>
<form action="debug/ap" method="post" class="panel panel-default">
<div class="panel-body">
{{$result.content nofilter}}
<div class="form-group">
{{include file="field_textarea.tpl" field=$source}}
</div>
<p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
</div>
</form>
{{if $results}}
<div class="babel-results">
{{foreach $results as $result}}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{$result.title}}</h3>
</div>
<div class="panel-body">
{{$result.content nofilter}}
</div>
</div>
{{/foreach}}
</div>
{{/foreach}}
{{/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 />