From 972c9f7bc00a63d37649b073b2e1118d0351429b Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 8 Mar 2021 21:17:27 +0000 Subject: [PATCH] Issue 9743: Added translatable texts --- src/Module/Admin/Item/Source.php | 22 +++- src/Module/Debug/ActivityPubConversion.php | 6 +- src/Module/Debug/Babel.php | 7 +- src/Module/Debug/Probe.php | 7 +- src/Module/Debug/WebFinger.php | 7 +- view/templates/admin/item/source.tpl | 114 +++++++++--------- view/templates/babel.tpl | 52 ++++---- .../templates/debug/activitypubconversion.tpl | 44 +++---- view/templates/probe.tpl | 6 +- view/templates/webfinger.tpl | 7 +- 10 files changed, 148 insertions(+), 124 deletions(-) diff --git a/src/Module/Admin/Item/Source.php b/src/Module/Admin/Item/Source.php index 83b57abbfe..785b4dc609 100644 --- a/src/Module/Admin/Item/Source.php +++ b/src/Module/Admin/Item/Source.php @@ -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; diff --git a/src/Module/Debug/ActivityPubConversion.php b/src/Module/Debug/ActivityPubConversion.php index 87a531d5b4..6bbb24d0c2 100644 --- a/src/Module/Debug/ActivityPubConversion.php +++ b/src/Module/Debug/ActivityPubConversion.php @@ -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; diff --git a/src/Module/Debug/Babel.php b/src/Module/Debug/Babel.php index f4a0fa1d95..322b742fbe 100644 --- a/src/Module/Debug/Babel.php +++ b/src/Module/Debug/Babel.php @@ -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; diff --git a/src/Module/Debug/Probe.php b/src/Module/Debug/Probe.php index 8090f2b082..ccb07e1239 100644 --- a/src/Module/Debug/Probe.php +++ b/src/Module/Debug/Probe.php @@ -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, ]); } } diff --git a/src/Module/Debug/WebFinger.php b/src/Module/Debug/WebFinger.php index ca26fd866e..f7d17027eb 100644 --- a/src/Module/Debug/WebFinger.php +++ b/src/Module/Debug/WebFinger.php @@ -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, ]); } } diff --git a/view/templates/admin/item/source.tpl b/view/templates/admin/item/source.tpl index a681d8739f..41e613b49c 100644 --- a/view/templates/admin/item/source.tpl +++ b/view/templates/admin/item/source.tpl @@ -1,65 +1,67 @@ -

Item Source

-
-
-
- {{include file="field_input.tpl" field=$guid}} +
+

{{$title}}

+ +
+
+ {{include file="field_input.tpl" field=$guid}} +
+

-

-
- + -{{if $source}} -
-
-
-

Item Id

+ {{if $source}} +
+
+
+

{{$itemidlbl}}

+
+
+ {{$item_id}} +
-
- {{$item_id}} +
+
+

{{$itemurilbl}}

+
+
+ {{$item_uri}} +
-
-
-
-

Item URI

+
+
+

{{$termslbl}}

+
+
+ + + + + + + {{foreach $terms as $term}} + + + + + + {{/foreach}} +
{{$typelbl}}{{$termlbl}}{{$urllbl}}
+ {{if $term.type == 1}}{{$tag}}{{/if}} + {{if $term.type == 2}}{{$mentionlbl}}{{/if}} + {{if $term.type == 8}}{{$implicitlbl}}{{/if}} + + {{$term.name}} + + {{$term.url}} +
+
-
- {{$item_uri}} +
+
+

{{$sourcelbl}}

+
+
{{$source}}
-
-
-

Terms

-
-
- - - - - - - {{foreach $terms as $term}} - - - - - - {{/foreach}} -
TypeTermURL
- {{if $term.type == 1}}Tag{{/if}} - {{if $term.type == 2}}Mention{{/if}} - {{if $term.type == 8}}Implicit Mention{{/if}} - - {{$term.name}} - - {{$term.url}} -
-
-
-
-
-

Source

-
-
{{$source}}
-
{{/if}} diff --git a/view/templates/babel.tpl b/view/templates/babel.tpl index 9b5a3d62ac..4e8e12d5c2 100644 --- a/view/templates/babel.tpl +++ b/view/templates/babel.tpl @@ -1,31 +1,33 @@ -

Babel Diagnostic

-
-
-
- {{include file="field_textarea.tpl" field=$text}} +
+

{{$title}}

+ +
+
+ {{include file="field_textarea.tpl" field=$text}} +
+
+ {{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}} +
+

-
- {{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}} -
-

-
- + -{{if $results}} -
- {{foreach $results as $result}} -
-
-

{{$result.title}}

+ {{if $results}} +
+ {{foreach $results as $result}} +
+
+

{{$result.title}}

+
+
{{$result.content nofilter}}
-
{{$result.content nofilter}}
+ {{/foreach}}
- {{/foreach}}
{{/if}} \ No newline at end of file diff --git a/view/templates/debug/activitypubconversion.tpl b/view/templates/debug/activitypubconversion.tpl index dfc6d73677..0717837f0b 100644 --- a/view/templates/debug/activitypubconversion.tpl +++ b/view/templates/debug/activitypubconversion.tpl @@ -1,24 +1,26 @@ -

ActivityPub Conversion

-
-
-
- {{include file="field_textarea.tpl" field=$source}} -
-

-
-
- -{{if $results}} -
- {{foreach $results as $result}} -
-
-

{{$result.title}}

-
+
+

{{$title}}

+
- {{$result.content nofilter}} +
+ {{include file="field_textarea.tpl" field=$source}} +
+

+
+ + {{if $results}} +
+ {{foreach $results as $result}} +
+
+

{{$result.title}}

+
+
+ {{$result.content nofilter}} +
+
+ {{/foreach}}
- {{/foreach}} -
-{{/if}} \ No newline at end of file + {{/if}} +
\ No newline at end of file diff --git a/view/templates/probe.tpl b/view/templates/probe.tpl index 5f31cc5488..d9c6d8a2d5 100644 --- a/view/templates/probe.tpl +++ b/view/templates/probe.tpl @@ -1,11 +1,11 @@
-

Probe Diagnostic

+

{{$title}}

{{include file="field_input.tpl" field=$addr}}
-

+

@@ -13,7 +13,7 @@
-

Output

+

{{$output}}

{{$res}}
diff --git a/view/templates/webfinger.tpl b/view/templates/webfinger.tpl index 109a7fce25..a324057cd7 100644 --- a/view/templates/webfinger.tpl +++ b/view/templates/webfinger.tpl @@ -1,9 +1,8 @@
-

Webfinger Diagnostic

- +

{{$title}}

- Lookup address: - + {{$lookup}} +