From 2253b6bbb8d55a68cea857c3a71b565bda1f7cb1 Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Sat, 25 Jun 2022 10:50:55 -0700
Subject: [PATCH] Fix block-editor translations

---
 README.md                                      |  8 +++++++-
 external-permalinks-redux.php                  |  4 +++-
 ...-external-permalinks-redux-block-editor.php |  6 ++++++
 languages/external-permalinks-redux.pot        | 18 +++++++++---------
 readme.txt                                     |  8 +++++++-
 5 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index 618eb4d..7953412 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
 **Tags:** link, redirect, external link, permalink  
 **Requires at least:** 3.0  
 **Tested up to:** 6.0  
-**Stable tag:** 1.3  
+**Stable tag:** 1.3.1  
 **License:** GPLv2 or later  
 **License URI:** http://www.gnu.org/licenses/gpl-2.0.html  
 
@@ -37,6 +37,9 @@ Using the `epr_post_types` filter, one can modify the default array of object ty
 
 ## Changelog ##
 
+### 1.3.1 ###
+* Fix translations in block editor.
+
 ### 1.3 ###
 * Introduce block-editor (Gutenberg) sidebar component for supported post types..
 
@@ -70,6 +73,9 @@ Using the `epr_post_types` filter, one can modify the default array of object ty
 
 ## Upgrade Notice ##
 
+### 1.3.1 ###
+Fixes translations in block editor.
+
 ### 1.3 ###
 Introduces block-editor (Gutenberg) sidebar component for supported post types.
 
diff --git a/external-permalinks-redux.php b/external-permalinks-redux.php
index f0d8d79..a3b9add 100644
--- a/external-permalinks-redux.php
+++ b/external-permalinks-redux.php
@@ -3,9 +3,11 @@
  * Plugin Name: External Permalinks Redux
  * Plugin URI: http://www.thinkoomph.com/plugins-modules/external-permalinks-redux/
  * Description: Allows users to point WordPress objects (posts, pages, custom post types) to a URL of your choosing. Inspired by and backwards-compatible with <a href="http://txfx.net/wordpress-plugins/page-links-to/">Page Links To</a> by Mark Jaquith. Written for use on WordPress.com VIP.
- * Version: 1.3
+ * Version: 1.3.1
  * Author: Erick Hitter & Oomph, Inc.
  * Author URI: http://www.thinkoomph.com/
+ * Text Domain: external-permalinks-redux
+ * Domain Path: /languages/
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/inc/class-external-permalinks-redux-block-editor.php b/inc/class-external-permalinks-redux-block-editor.php
index db496dd..73df4a1 100644
--- a/inc/class-external-permalinks-redux-block-editor.php
+++ b/inc/class-external-permalinks-redux-block-editor.php
@@ -152,6 +152,12 @@ class External_Permalinks_Redux_Block_Editor {
 				'statusCodes' => $this->_get_status_codes(),
 			)
 		);
+
+		wp_set_script_translations(
+			$asset_handle,
+			'external-permalinks-redux',
+			dirname( dirname( __FILE__ ) ) . '/languages'
+		);
 	}
 
 	/**
diff --git a/languages/external-permalinks-redux.pot b/languages/external-permalinks-redux.pot
index 5eb8c86..80ff1c3 100644
--- a/languages/external-permalinks-redux.pot
+++ b/languages/external-permalinks-redux.pot
@@ -2,10 +2,10 @@
 # This file is distributed under the same license as the External Permalinks Redux package.
 msgid ""
 msgstr ""
-"Project-Id-Version: External Permalinks Redux 1.3\n"
+"Project-Id-Version: External Permalinks Redux 1.3.1\n"
 "Report-Msgid-Bugs-To: "
 "https://wordpress.org/support/plugin/external-permalinks-redux\n"
-"POT-Creation-Date: 2022-06-12 04:03:04+00:00\n"
+"POT-Creation-Date: 2022-06-25 17:40:29+00:00\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -25,11 +25,11 @@ msgstr ""
 "X-Textdomain-Support: yes\n"
 "X-Generator: grunt-wp-i18n 1.0.3\n"
 
-#: external-permalinks-redux.php:167
+#: external-permalinks-redux.php:169
 msgid "Temporary (302)"
 msgstr ""
 
-#: external-permalinks-redux.php:168
+#: external-permalinks-redux.php:170
 msgid "Permanent (301)"
 msgstr ""
 
@@ -37,20 +37,20 @@ msgstr ""
 msgid "External Permalinks Redux"
 msgstr ""
 
-#: external-permalinks-redux.php:217
+#: external-permalinks-redux.php:219
 msgid "Destination Address:"
 msgstr ""
 
-#: external-permalinks-redux.php:221
+#: external-permalinks-redux.php:223
 msgid "To restore the original permalink, remove the link entered above."
 msgstr ""
 
-#: external-permalinks-redux.php:226
+#: external-permalinks-redux.php:228
 msgid "Redirect Type:"
 msgstr ""
 
-#: external-permalinks-redux.php:228
-#: inc/class-external-permalinks-redux-block-editor.php:166
+#: external-permalinks-redux.php:230
+#: inc/class-external-permalinks-redux-block-editor.php:172
 msgid "-- Select --"
 msgstr ""
 
diff --git a/readme.txt b/readme.txt
index 8adca3c..8941977 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Donate link: http://www.thinkoomph.com/plugins-modules/external-permalinks-redux
 Tags: link, redirect, external link, permalink
 Requires at least: 3.0
 Tested up to: 6.0
-Stable tag: 1.3
+Stable tag: 1.3.1
 License: GPLv2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
@@ -37,6 +37,9 @@ Using the `epr_post_types` filter, one can modify the default array of object ty
 
 == Changelog ==
 
+= 1.3.1 =
+* Fix translations in block editor.
+
 = 1.3 =
 * Introduce block-editor (Gutenberg) sidebar component for supported post types..
 
@@ -70,6 +73,9 @@ Using the `epr_post_types` filter, one can modify the default array of object ty
 
 == Upgrade Notice ==
 
+= 1.3.1 =
+Fixes translations in block editor.
+
 = 1.3 =
 Introduces block-editor (Gutenberg) sidebar component for supported post types.
 
-- 
GitLab