diff --git a/ayecode-connect.php b/ayecode-connect.php
index be06bc5..3416bcd 100644
--- a/ayecode-connect.php
+++ b/ayecode-connect.php
@@ -6,7 +6,7 @@
* Description: A service plugin letting users connect AyeCode Services to their site.
* Version: 1.0.0
* Author: AyeCode
- * Author URI: https://ayecode.io/
+ * Author URI: https://ayecode.io
* Requires at least: 4.7
* Tested up to: 5.3
*
@@ -42,6 +42,8 @@ function ayecode_connect() {
//Call the init method to register routes. This should be called exactly once per client (Preferably before the init hook).
$client->init();
+ // Load textdomain
+ load_plugin_textdomain( 'ayecode-connect', false, basename( dirname( __FILE__ ) ) . '/languages/' );
}
/**
diff --git a/includes/class-ayecode-connect-settings.php b/includes/class-ayecode-connect-settings.php
index efc1ed6..646775e 100644
--- a/includes/class-ayecode-connect-settings.php
+++ b/includes/class-ayecode-connect-settings.php
@@ -370,7 +370,7 @@ class="text-muted">
$connect_url = esc_url( $this->client->build_connect_url() );
?>
Connect Site button, you agree to our Terms of Service and to share details with AyeCode Ltd", "ayecode-connect" ); ?>
+ class="text-muted">Connect Site button, you agree to our Terms of Service and to share details with AyeCode Ltd", "ayecode-connect" ); ?>
@@ -386,7 +386,7 @@ class="btn btn-primary">
diff --git a/includes/class-ayecode-connect.php b/includes/class-ayecode-connect.php
index d5ab52b..c165dae 100644
--- a/includes/class-ayecode-connect.php
+++ b/includes/class-ayecode-connect.php
@@ -84,7 +84,7 @@ public function __construct( array $args = array() ) {
*
*/
public function init() {
- add_action( 'rest_api_init', array( $this, 'register_connected_routes' ) );
+
if ( $this->is_active() ) {
//Connected
@@ -692,7 +692,7 @@ public function is_api_request_authenticated( $request ) {
$headers = $request->get_header_as_array( 'Authorization' );
if ( empty( $headers ) ) {
- return new WP_Error( 'rest_forbidden', esc_html__( 'Missing Authorization Header.1', 'ayecode-connect' ), array( 'status' => 401 ) );
+ return new WP_Error( 'rest_forbidden', esc_html__( 'Missing Authorization Header.', 'ayecode-connect' ), array( 'status' => 401 ) );
}
$jwt = '';
@@ -708,7 +708,7 @@ public function is_api_request_authenticated( $request ) {
//Ensure the jwt auth is set...
if ( empty( $jwt ) ) {
- return new WP_Error( 'rest_forbidden', esc_html__( 'Missing Authorization Header.2', 'ayecode-connect' ), array( 'status' => 401 ) );
+ return new WP_Error( 'rest_forbidden', esc_html__( 'Missing Authorization Header.', 'ayecode-connect' ), array( 'status' => 401 ) );
}
//And is valid
@@ -927,7 +927,7 @@ public function has_permission( $request ) {
//Ensure the jwt auth is set...
if ( empty( $jwt ) ) {
- return new WP_Error( 'rest_forbidden', esc_html__( 'Missing Authorization Header.3', 'ayecode-connect' ), array( 'status' => 401 ) );
+ return new WP_Error( 'rest_forbidden', esc_html__( 'Missing Authorization Header.', 'ayecode-connect' ), array( 'status' => 401 ) );
}
//And is valid
diff --git a/languages/ayecode-connect-en_US.mo b/languages/ayecode-connect-en_US.mo
new file mode 100644
index 0000000..ba3b739
Binary files /dev/null and b/languages/ayecode-connect-en_US.mo differ
diff --git a/languages/ayecode-connect-en_US.po b/languages/ayecode-connect-en_US.po
new file mode 100644
index 0000000..50768d5
--- /dev/null
+++ b/languages/ayecode-connect-en_US.po
@@ -0,0 +1,133 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: AyeCode Connect 1.0.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-02-18 17:53+0000\n"
+"PO-Revision-Date: 2020-02-18 17:53+0000\n"
+"Last-Translator: \n"
+"Language-Team: AyeCode Ltd \n"
+"Language: en_US\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: __;__ngettext:1,2;__ngettext_noop:1,2;_c;_e;_ex:1,2c;"
+"_n:1,2;_n_noop:1,2;_nc:4c,1,2;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;esc_attr__;"
+"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;gettext;"
+"gettext_noop\n"
+"X-Poedit-Basepath: ..\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+"X-Generator: Poedit 1.8.7.1\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: includes/class-ayecode-connect-remote-actions.php:326
+msgid "Download source not valid."
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:201
+msgid "Plugin and theme update notifications must be enabled first"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:261
+msgid "Something went wrong, try refreshing the page and trying again."
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:262
+msgid "Are you sure you with to disconnect your site?"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:300
+msgid ""
+"One click addon installs, live documentation search, support right from your "
+"WordPress Dashboard"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:308
+#, php-format
+msgid "You are connected to AyeCode Connect as user: %s"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:315
+msgid "Plugin and theme update notifications"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:318
+#: includes/class-ayecode-connect-settings.php:336
+#: includes/class-ayecode-connect-settings.php:361
+msgid "Loading..."
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:333
+msgid "One click addon installs, no more licence keys"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:366
+msgid "Disconnect site"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:373
+msgid ""
+"By clicking the Connect Site button, you agree to our Terms of Service and to share details with AyeCode Ltd"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:376
+msgid "Connect Site"
+msgstr ""
+
+#: includes/class-ayecode-connect-settings.php:387
+msgid "AycCode Ltd are the creators of:"
+msgstr ""
+
+#: includes/class-ayecode-connect.php:297
+msgid "Invalid Registration Data"
+msgstr ""
+
+#: includes/class-ayecode-connect.php:301
+msgid "Invalid Secret"
+msgstr ""
+
+#: includes/class-ayecode-connect.php:558
+#, php-format
+msgid "Domain `%1$s` just failed is_usable_domain check as it is empty."
+msgstr ""
+
+#: includes/class-ayecode-connect.php:588
+#, php-format
+msgid ""
+"Domain `%1$s` just failed is_usable_domain check as it is in the forbidden "
+"array."
+msgstr ""
+
+#: includes/class-ayecode-connect.php:603
+#, php-format
+msgid ""
+"Domain `%1$s` just failed is_usable_domain check as it uses an invalid top "
+"level domain."
+msgstr ""
+
+#: includes/class-ayecode-connect.php:695
+#: includes/class-ayecode-connect.php:711
+#: includes/class-ayecode-connect.php:930
+msgid "Missing Authorization Header."
+msgstr ""
+
+#: includes/class-ayecode-connect.php:717
+#: includes/class-ayecode-connect.php:936
+#: includes/class-ayecode-connect.php:942
+msgid "Invalid Authorization Header."
+msgstr ""
+
+#: includes/class-ayecode-connect.php:724
+msgid "Missing blog token."
+msgstr ""
+
+#: includes/class-ayecode-connect.php:729
+#: includes/class-ayecode-connect.php:950
+msgid "You are not authorized to do that."
+msgstr ""
+
+#: includes/class-ayecode-connect.php:1001
+msgid "Specify an action"
+msgstr ""
diff --git a/languages/index.php b/languages/index.php
new file mode 100644
index 0000000..cf879a5
--- /dev/null
+++ b/languages/index.php
@@ -0,0 +1,2 @@
+