Skip to content

Commit 5b3f6d5

Browse files
Added translations for the widget
1 parent 24b2f66 commit 5b3f6d5

8 files changed

Lines changed: 109 additions & 52 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
=========
33

4+
2.1.6 (2025-03-24)
5+
- Added translation for the widget
6+
47
2.1.3 (2024-11-27)
58
- Use password type for API Key field for hide it. Fix warning related co compact() method
69

includes/options-page.php

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@
7777
$link = sprintf(
7878
wp_kses(
7979
__('A <a href="%1$s" target="%2$s">Mailgun</a> account is required to use this plugin and the Mailgun service.', 'mailgun'),
80-
array(
81-
'a' => array(
82-
'href' => array(),
83-
'target' => array(),
84-
),
85-
)
80+
[
81+
'a' => [
82+
'href' => [],
83+
'target' => [],
84+
],
85+
]
8686
),
8787
esc_url($url),
8888
'_blank'
@@ -97,12 +97,12 @@
9797
$link = sprintf(
9898
wp_kses(
9999
__('If you need to register for an account, you can do so at <a href="%1$s" target="%2$s">Mailgun.com</a>.', 'mailgun'),
100-
array(
101-
'a' => array(
102-
'href' => array(),
103-
'target' => array(),
104-
),
105-
)
100+
[
101+
'a' => [
102+
'href' => [],
103+
'target' => [],
104+
],
105+
]
106106
),
107107
esc_url($url),
108108
'_blank'
@@ -282,12 +282,12 @@
282282
$link = __('If enabled, Mailgun will track links. <a href="https://documentation.mailgun.com/en/latest/user_manual.html#tracking-clicks" target="_blank">Open Tracking Documentation</a>.', 'mailgun');
283283
echo wp_kses(
284284
$link,
285-
array(
286-
'a' => array(
287-
'href' => array(),
288-
'target' => array(),
289-
),
290-
)
285+
[
286+
'a' => [
287+
'href' => [],
288+
'target' => [],
289+
],
290+
]
291291
);
292292
?>
293293
</p>
@@ -306,12 +306,12 @@
306306
<?php
307307
echo wp_kses(
308308
__('If enabled, HTML messages will include an open tracking beacon. <a href="https://documentation.mailgun.com/en/latest/user_manual.html#tracking-opens" target="_blank">Open Tracking Documentation</a>.', 'mailgun'),
309-
array(
310-
'a' => array(
311-
'href' => array(),
312-
'target' => array(),
313-
),
314-
)
309+
[
310+
'a' => [
311+
'href' => [],
312+
'target' => [],
313+
],
314+
]
315315
);
316316
?>
317317
</p>
@@ -405,12 +405,12 @@ class="regular-text"
405405

406406
echo wp_kses(
407407
__('<a href="https://documentation.mailgun.com/en/latest/user_manual.html#tracking-messages" target="_blank">Tracking</a> and <a href="https://documentation.mailgun.com/en/latest/user_manual.html#tagging" target="_blank">Tagging</a>', 'mailgun'),
408-
array(
409-
'a' => array(
410-
'href' => array(),
411-
'target' => array(),
412-
),
413-
)
408+
[
409+
'a' => [
410+
'href' => [],
411+
'target' => [],
412+
],
413+
]
414414
);
415415
?>
416416
</p>
@@ -462,11 +462,11 @@ class="regular-text"
462462
$link = sprintf(
463463
wp_kses(
464464
__('<a href="%1$s" target="%2$s">View available lists</a>.', 'mailgun'),
465-
array(
466-
'a' => array(
467-
'href' => array(),
468-
),
469-
)
465+
[
466+
'a' => [
467+
'href' => [],
468+
],
469+
]
470470
),
471471
esc_url($url)
472472
);

languages/mailgun-ca.po

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,19 @@ msgstr ""
207207
#: includes/options-page.php:74
208208
msgid "Save Changes"
209209
msgstr "Desar els canvis"
210+
211+
#: includes/widget.php:84
212+
msgid "Title (optional):"
213+
msgstr "Titre (optionnel):"
214+
215+
#: includes/widget.php:88
216+
msgid "Description (optional):"
217+
msgstr "Description (optionnelle):"
218+
219+
#: includes/widget.php:92
220+
msgid "List addresses (required):"
221+
msgstr "Lister les adresses (obligatoire):"
222+
223+
#: includes/widget.php:96
224+
msgid "Collect name:"
225+
msgstr "Collecter le nom:"

languages/mailgun-de_DE.po

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,19 @@ msgstr "Antwortadresse"
210210

211211
msgid "Suppress Click Track for password reset email"
212212
msgstr "Klick-Tracking für Passwort-Reset-Email unterdrücken"
213+
214+
#: includes/widget.php:84
215+
msgid "Title (optional):"
216+
msgstr "Titel (optional):"
217+
218+
#: includes/widget.php:88
219+
msgid "Description (optional):"
220+
msgstr "Beschreibung (optional):"
221+
222+
#: includes/widget.php:92
223+
msgid "List addresses (required):"
224+
msgstr "Adressen auflisten (erforderlich):"
225+
226+
#: includes/widget.php:96
227+
msgid "Collect name:"
228+
msgstr "Namen erfassen:"

languages/mailgun-es_ES.po

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,19 @@ msgstr "dirección de respuesta"
211211

212212
msgid "Suppress Click Track for password reset email"
213213
msgstr "Suprimir seguimiento de clics para el email de restablecimiento de contraseña"
214+
215+
#: includes/widget.php:84
216+
msgid "Title (optional):"
217+
msgstr "Título (opcional):"
218+
219+
#: includes/widget.php:88
220+
msgid "Description (optional):"
221+
msgstr "Descripción (opcional):"
222+
223+
#: includes/widget.php:92
224+
msgid "List addresses (required):"
225+
msgstr "Listar direcciones (obligatorio):"
226+
227+
#: includes/widget.php:96
228+
msgid "Collect name:"
229+
msgstr "Recopilar nombre:"

mailgun.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Mailgun
44
* Plugin URI: http://wordpress.org/extend/plugins/mailgun/
55
* Description: Mailgun integration for WordPress
6-
* Version: 2.1.6
6+
* Version: 2.1.7
77
* Requires PHP: 7.4
88
* Requires at least: 4.4
99
* Author: Mailgun
@@ -227,9 +227,9 @@ public function api_call( string $uri, array $params = array(), string $method =
227227

228228
$time = time();
229229
$url = $this->api_endpoint . $uri;
230-
$headers = array(
230+
$headers = [
231231
'Authorization' => 'Basic ' . base64_encode( "api:{$apiKey}" ),
232-
);
232+
];
233233

234234
switch ( $method ) {
235235
case 'GET':
@@ -248,12 +248,12 @@ public function api_call( string $uri, array $params = array(), string $method =
248248
}
249249

250250
// make the request
251-
$args = array(
251+
$args = [
252252
'method' => $method,
253253
'body' => $params,
254254
'headers' => $headers,
255255
'sslverify' => true,
256-
);
256+
];
257257

258258
// make the remote request
259259
$result = wp_remote_request( $url, $args );
@@ -282,9 +282,9 @@ public function api_call( string $uri, array $params = array(), string $method =
282282
* @throws JsonException
283283
*/
284284
public function get_lists(): array {
285-
$results = array();
285+
$results = [];
286286

287-
$lists_json = $this->api_call( 'lists', array(), 'GET' );
287+
$lists_json = $this->api_call( 'lists', [], 'GET' );
288288

289289
$lists_arr = json_decode( $lists_json, true, 512, JSON_THROW_ON_ERROR );
290290
if ( isset( $lists_arr['items'] ) && ! empty( $lists_arr['items'] ) ) {
@@ -304,20 +304,20 @@ public function get_lists(): array {
304304
public function add_list(): void {
305305
$name = sanitize_text_field( $_POST['name'] ?? null );
306306
$email = sanitize_text_field( $_POST['email'] ?? null );
307-
$list_addresses = array();
307+
$list_addresses = [];
308308
foreach ( $_POST['addresses'] as $address => $val ) {
309309
$list_addresses[ sanitize_text_field( $address ) ] = sanitize_text_field( $val );
310310
}
311311

312312
if ( ! empty( $list_addresses ) ) {
313-
$result = array();
313+
$result = [];
314314
foreach ( $list_addresses as $address => $val ) {
315315
$result[] = $this->api_call(
316316
"lists/{$address}/members",
317-
array(
317+
[
318318
'address' => $email,
319319
'name' => $name,
320-
)
320+
]
321321
);
322322
}
323323
$message = 'Thank you!';
@@ -329,18 +329,18 @@ public function add_list(): void {
329329
}
330330
}
331331
echo json_encode(
332-
array(
332+
[
333333
'status' => 200,
334334
'message' => $message,
335-
),
335+
],
336336
JSON_THROW_ON_ERROR
337337
);
338338
} else {
339339
echo json_encode(
340-
array(
340+
[
341341
'status' => 500,
342342
'message' => 'Uh oh. We weren\'t able to add you to the list' . count( $list_addresses ) ? 's.' : '. Please try again.',
343-
),
343+
],
344344
JSON_THROW_ON_ERROR
345345
);
346346
}

readme.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Mailgun for WordPress
44
Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller
55
Tags: mailgun, smtp, http, api, mail, email
66
Tested up to: 6.7.2
7-
Stable tag: 2.1.6
7+
Stable tag: 2.1.7
88
Requires PHP: 7.4
99
License: GPLv2 or later
1010

@@ -133,6 +133,9 @@ MAILGUN_REPLY_TO_ADDRESS Type: string
133133

134134
== Changelog ==
135135

136+
= 2.1.6 (2025-03-24): =
137+
- Added translation for the widget
138+
136139
= 2.1.6 (2025-03-07): =
137140
- Fixed bug with sending test emails (JS error). Basically it's 2.1.5. Just version updates
138141

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Mailgun for WordPress
44
Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller
55
Tags: mailgun, smtp, http, api, mail, email
66
Tested up to: 6.7.2
7-
Stable tag: 2.1.6
7+
Stable tag: 2.1.7
88
Requires PHP: 7.4
99
License: GPLv2 or later
1010

@@ -129,6 +129,9 @@ MAILGUN_TRACK_OPENS Type: string Choices: 'yes' or 'no'
129129

130130
== Changelog ==
131131

132+
= 2.1.6 (2025-03-24): =
133+
- Added translation for the widget
134+
132135
= 2.1.6 (2025-03-07): =
133136
- Fixed bug with sending test emails (JS error). Basically it's 2.1.5. Just version updates
134137

0 commit comments

Comments
 (0)