]> git.mxchange.org Git - friendica.git/commitdiff
Move translation strings in their own array for confirm templates
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Oct 2021 15:26:14 +0000 (11:26 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Oct 2021 17:52:54 +0000 (13:52 -0400)
mod/photos.php
src/Module/Contact.php
view/templates/confirm.tpl
view/templates/contact_drop_confirm.tpl
view/theme/frio/templates/confirm.tpl
view/theme/frio/templates/contact_drop_confirm.tpl

index 209b9fb7beca5ed61a47949255a62f62f0df42dc..107171f673184460fb21e2e53555812153d75334 100644 (file)
@@ -1020,13 +1020,15 @@ function photos_content(App $a)
                        $drop_url = DI::args()->getQueryString();
 
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
-                               '$method' => 'post',
-                               '$message' => DI::l10n()->t('Do you really want to delete this photo album and all its photos?'),
-                               '$confirm' => DI::l10n()->t('Delete Album'),
-                               '$confirm_url' => $drop_url,
-                               '$confirm_name' => 'dropalbum',
+                               '$l10n'           => [
+                                       'message' => DI::l10n()->t('Do you really want to delete this photo album and all its photos?'),
+                                       'confirm' => DI::l10n()->t('Delete Album'),
+                                       'cancel'  => DI::l10n()->t('Cancel'),
+                               ],
+                               '$method'        => 'post',
+                               '$confirm_url'   => $drop_url,
+                               '$confirm_name'  => 'dropalbum',
                                '$confirm_value' => 'dropalbum',
-                               '$cancel' => DI::l10n()->t('Cancel'),
                        ]);
                }
 
@@ -1127,13 +1129,15 @@ function photos_content(App $a)
                        $drop_url = DI::args()->getQueryString();
 
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
-                               '$method' => 'post',
-                               '$message' => DI::l10n()->t('Do you really want to delete this photo?'),
-                               '$confirm' => DI::l10n()->t('Delete Photo'),
-                               '$confirm_url' => $drop_url,
-                               '$confirm_name' => 'delete',
+                               '$l10n'           => [
+                                       'message' => DI::l10n()->t('Do you really want to delete this photo?'),
+                                       'confirm' => DI::l10n()->t('Delete Photo'),
+                                       'cancel'  => DI::l10n()->t('Cancel'),
+                               ],
+                               '$method'        => 'post',
+                               '$confirm_url'   => $drop_url,
+                               '$confirm_name'  => 'delete',
                                '$confirm_value' => 'delete',
-                               '$cancel' => DI::l10n()->t('Cancel'),
                        ]);
                }
 
index bf0e3bfaf2a47e180f49ae33709bdf7f3eb81269..b671de5e1938d7134e6c8849d9bae6162da1d52e 100644 (file)
@@ -432,15 +432,17 @@ class Contact extends BaseModule
                                        DI::page()['aside'] = '';
 
                                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('contact_drop_confirm.tpl'), [
-                                               '$header' => DI::l10n()->t('Drop contact'),
+                                               '$l10n' => [
+                                                       'header' => DI::l10n()->t('Drop contact'),
+                                                       'message' => DI::l10n()->t('Do you really want to delete this contact?'),
+                                                       'confirm' => DI::l10n()->t('Yes'),
+                                                       'cancel' => DI::l10n()->t('Cancel'),
+                                               ],
                                                '$contact' => self::getContactTemplateVars($orig_record),
                                                '$method' => 'get',
-                                               '$message' => DI::l10n()->t('Do you really want to delete this contact?'),
-                                               '$confirm' => DI::l10n()->t('Yes'),
                                                '$confirm_url' => DI::args()->getCommand(),
                                                '$confirm_name' => 't',
                                                '$confirm_value' => BaseModule::getFormSecurityToken('contact_action'),
-                                               '$cancel' => DI::l10n()->t('Cancel'),
                                        ]);
                                }
                                // Now check how the user responded to the confirmation query
index 47f231a5f9a09fbaaecbe4893997fee1f9317285..b64cd4bd98b4d8a4c2c59eaa905ffe175a697995 100644 (file)
@@ -2,10 +2,10 @@
 <center>
 <form action="{{$confirm_url}}" id="confirm-form" method="{{$method}}">
 
-       <h3 id="confirm-message">{{$message}}</h3>
+       <h3 id="confirm-message">{{$l10n.message}}</h3>
 
-       <button class="confirm-button" id="confirm-submit-button" type="submit" name="{{$confirm_name}}" value="{{$confirm_value}}">{{$confirm}}</button>
-       <button class="confirm-button" id="confirm-cancel-button" type="submit" name="canceled" value="{{$cancel}}">{{$cancel}}</button>
+       <button class="confirm-button" id="confirm-submit-button" type="submit" name="{{$confirm_name}}" value="{{$confirm_value}}">{{$l10n.confirm}}</button>
+       <button class="confirm-button" id="confirm-cancel-button" type="submit" name="canceled" value="{{$l10n.cancel}}">{{$l10n.cancel}}</button>
 
 </form>
 </center>
index 48b61832d45e48a91dd64ab2488572c6fe783e8c..bb4d3a10cbe88697c5100f8a64f313fb212d0cc4 100644 (file)
@@ -1,8 +1,8 @@
-<h1>{{$header}}</h1>\r
-\r
-{{include file="contact_template.tpl" no_contacts_checkbox=True}}\r
-\r
-{{include file="confirm.tpl"}}\r
-\r
-\r
+<h1>{{$l10n.header}}</h1>
+
+{{include file="contact_template.tpl" no_contacts_checkbox=True}}
+
+{{include file="confirm.tpl"}}
+
+
 <div class="clear"></div>
\ No newline at end of file
index 5e173d68cd4745728c79d623c539b15854f7e214..b1fc8eb9ee78f98ae20fcd3a786060c8131fbd6b 100644 (file)
@@ -1,9 +1,9 @@
 
 <form action="{{$confirm_url}}" id="confirm-form" method="{{$method}}" class="generic-page-wrapper">
-       <div id="confirm-message">{{$message}}</div>
+       <div id="confirm-message">{{$l10n.message}}</div>
 
        <div class="form-group pull-right settings-submit-wrapper">
-               <button type="submit" name="{{$confirm_name}}" id="confirm-submit-button" class="btn btn-primary confirm-button" value="{{$confirm_value}}">{{$confirm}}</button>
-               <button type="submit" name="canceled" value="{{$cancel}} id="confirm-cancel-button" class="btn confirm-button" data-dismiss="modal">{{$cancel}}</button>
+               <button type="submit" name="{{$confirm_name}}" id="confirm-submit-button" class="btn btn-primary confirm-button" value="{{$confirm_value}}">{{$l10n.confirm}}</button>
+               <button type="submit" name="canceled" value="{{$l10n.cancel}}" id="confirm-cancel-button" class="btn confirm-button" data-dismiss="modal">{{$l10n.cancel}}</button>
        </div>
 </form>
index d665fefed0c5ad3f87e810481c4a9d16e3a6b954..a0ac15cf6df645342bb4a58261376b3c3fb50438 100644 (file)
@@ -1,9 +1,9 @@
-<div id="contact-drop-confirm">\r
-       <h2 class="heading">{{$header}}</h2>\r
-\r
-       {{include file="contact_template.tpl" no_contacts_checkbox=True}}\r
-\r
-       {{include file="confirm.tpl"}}\r
-\r
-       <div class="clear"></div>\r
-</div>\r
+<div id="contact-drop-confirm">
+       <h2 class="heading">{{$l10n.header}}</h2>
+
+       {{include file="contact_template.tpl" no_contacts_checkbox=True}}
+
+       {{include file="confirm.tpl"}}
+
+       <div class="clear"></div>
+</div>