Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/src/blocks/login-button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';

/**
* Editor styles for the block.
Expand Down Expand Up @@ -45,7 +45,7 @@ export default function Edit( { attributes, setAttributes, className } ) {
setAttributes( { buttonText: value } );
},
value: buttonText,
placeholder: __( 'Login with Google', 'login-with-google' ),
placeholder: _x( 'Login with Google', 'Login button text displayed in block.', 'login-with-google' ),
};

const forceDisplayAttributes = {
Expand Down
46 changes: 30 additions & 16 deletions languages/login-with-google.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2025-08-19T16:58:53+00:00\n"
"POT-Creation-Date: 2025-11-19T12:28:53+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.10.0\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: login-with-google\n"

#. Plugin Name of the plugin
#: login-with-google.php
#: src/Modules/Settings.php:324
#: templates/google-login-button.php:14
#: assets/build/blocks/login-button/index.js:1
#: assets/src/blocks/login-button/edit.js:48
#: assets/build/blocks/login-button/index.js:86
#: assets/build/blocks/login-button/index.js:48
msgid "Login with Google"
msgstr ""

Expand Down Expand Up @@ -48,9 +46,15 @@ msgstr ""

#. translators: %$s is replaced with requested service name.
#: src/Container.php:66
#, php-format
msgid "Invalid Service %s Passed to the container"
msgstr ""

#: src/Modules/Block.php:144
msgctxt "Login button text displayed in block."
msgid "Login with Google"
msgstr ""

#: src/Modules/Login.php:166
msgid "Could not authenticate the user, please try again."
msgstr ""
Expand Down Expand Up @@ -101,6 +105,7 @@ msgstr ""

#. translators: %1s will be replaced by page link
#: src/Modules/Settings.php:224
#, php-format
msgid "If this setting is checked, a new user will be created even if <a target=\"_blank\" href=\"%1s\">membership setting</a> is off."
msgstr ""

Expand All @@ -124,13 +129,19 @@ msgstr ""
msgid "Login with Google settings"
msgstr ""

#: src/Modules/Settings.php:324
msgctxt "Menu title"
msgid "Login with Google"
msgstr ""

#: src/Modules/Shortcode.php:101
msgid "Login with google"
msgctxt "Login button text displayed in shortcode."
msgid "Login with Google"
msgstr ""

#: src/Plugin.php:160
#: assets/build/blocks/login-button/index.js:1
#: assets/src/blocks/login-button/edit.js:67
#: assets/build/blocks/login-button/index.js:103
#: assets/build/blocks/login-button/index.js:67
msgid "Settings"
msgstr ""

Expand All @@ -144,6 +155,7 @@ msgstr ""

#. translators: %s is replaced with email ID of user trying to register
#: src/Utils/Authenticator.php:124
#, php-format
msgid "Cannot register with this email: %s"
msgstr ""

Expand Down Expand Up @@ -185,33 +197,35 @@ msgstr ""
msgid "User data is stale! Please try again."
msgstr ""

#: templates/google-login-button.php:14
msgctxt "Default login button text."
msgid "Login with Google"
msgstr ""

#: templates/google-login-button.php:24
msgid "Log out"
msgstr ""

#: assets/build/blocks/login-button/index.js:1
#: assets/src/blocks/login-button/edit.js:52
#: assets/build/blocks/login-button/index.js:89
#: assets/build/blocks/login-button/index.js:52
msgid "Display Logout"
msgstr ""

#: assets/build/blocks/login-button/index.js:1
#: assets/src/blocks/login-button/edit.js:53
#: assets/build/blocks/login-button/index.js:90
#: assets/build/blocks/login-button/index.js:53
msgid "If the user is logged in, keeping this box unchecked will remove the Login with Google button from the page. If the box is checked, the button will show with title changed to ‘Logout’"
msgstr ""

#: assets/build/js/onetap.js:22
#: assets/src/js/onetap.js:22
msgid "Invalid URL for Redirection"
msgstr ""

#: assets/build/blocks/login-button/block.json
#: assets/src/blocks/login-button/block.json
msgctxt "block title"
msgid "Log in with Google"
msgstr ""

#: assets/build/blocks/login-button/block.json
#: assets/src/blocks/login-button/block.json
msgctxt "block description"
msgid "Login with Google button block."
msgstr ""
2 changes: 1 addition & 1 deletion src/Modules/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function render_login_button( array $attributes ): string {
$markup = $this->markup(
[
'login_url' => $this->client->authorization_url(),
'custom_btn_text' => $attributes['buttonText'] ?? false,
'custom_btn_text' => $attributes['buttonText'] ?? _x( 'Login with Google', 'Login button text displayed in block.', 'login-with-google' ),
Comment thread
mi5t4n marked this conversation as resolved.
Outdated
'force_display_block' => $attributes['forceDisplay'] ?? false,
]
);
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function whitelisted_domains(): void {
public function settings_page(): void {
add_options_page(
__( 'Login with Google settings', 'login-with-google' ),
__( 'Login with Google', 'login-with-google' ),
_x( 'Login with Google', 'Menu title', 'login-with-google' ),
'manage_options',
'login-with-google',
[ $this, 'output' ]
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/Shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function callback( $attrs = [] ): string {
$redirect_to = Helper::get_redirect_url();
$attrs = shortcode_atts(
[
'button_text' => __( 'Login with google', 'login-with-google' ),
'button_text' => _x( 'Login with Google', 'Login button text displayed in shortcode.', 'login-with-google' ),
'force_display' => 'no',
'redirect_to' => $redirect_to,
],
Expand Down
2 changes: 1 addition & 1 deletion templates/google-login-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if ( isset( $custom_btn_text ) && $custom_btn_text ) {
$button_text = esc_html( $custom_btn_text );
} else {
$button_text = ( ! empty( $button_text ) ) ? $button_text : __( 'Login with Google', 'login-with-google' );
$button_text = ( ! empty( $button_text ) ) ? $button_text : _x( 'Login with Google', 'Default login button text.', 'login-with-google' );
}

if ( empty( $login_url ) ) {
Expand Down
Loading