Skip to content

Add translation context to "Login with Google" text to improve translation accuracy.#286

Open
mi5t4n wants to merge 9 commits intodevelopfrom
fix/283
Open

Add translation context to "Login with Google" text to improve translation accuracy.#286
mi5t4n wants to merge 9 commits intodevelopfrom
fix/283

Conversation

@mi5t4n
Copy link
Member

@mi5t4n mi5t4n commented Nov 19, 2025

Description

This PR adds translation context to multiple instances of the Login with Google text to improve translation accuracy. Context has been added separately for the shortcode, block, login page, and menu title to ensure each is translated appropriately.

This PR also updates the shortcode login text from Login with google to Login with Google to ensure consistency with the block and login page, where the correct capitalisation is already used.

How to Test?

  1. Install Loco Translate
  2. Translate the plugin through Loco Translate
  3. Search for Login With Google, you should be able to see the different context.

Screenshots

Before

  1. Login Page
2025-11-19_17-56_1
  1. Shortcode/Block
2025-11-19_17-56

After

  1. Shortcode
2025-11-19_17-57

Closes - #283

@mi5t4n mi5t4n self-assigned this Nov 19, 2025
Copilot AI review requested due to automatic review settings November 19, 2025 12:15
@mi5t4n mi5t4n requested a review from mchirag2002 November 19, 2025 12:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances internationalization (i18n) by adding translation contexts to "Login with Google" text strings throughout the plugin, ensuring translators understand the usage context for each instance. It also corrects a capitalization inconsistency in the shortcode module.

  • Adds contextual information to translation strings using _x() instead of __() for four different use cases (shortcode, block, login page, and menu title)
  • Fixes capitalization from "Login with google" to "Login with Google" in the shortcode module
  • Updates the block editor placeholder to use the same contextual translation approach

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
templates/google-login-button.php Updates fallback button text with translation context for login page usage
src/Modules/Shortcode.php Fixes capitalization and adds translation context for shortcode button text
src/Modules/Settings.php Adds translation context for the admin menu title
src/Modules/Block.php Adds translation context for block button text default value
assets/src/blocks/login-button/edit.js Imports _x function and adds translation context for block editor placeholder

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants