Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak: Replace translate() with gettext filters in dynamic translation function #1028

Merged
merged 6 commits into from
Jan 24, 2025

Conversation

alexmigf
Copy link
Member

closes #1027

Copy link
Contributor

@MohamadNateqi MohamadNateqi left a comment

Choose a reason for hiding this comment

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

LGTM!

May I ask why this has been replaced?

@alexmigf
Copy link
Member Author

Since translate() requires the actual string to be passed directly instead of a variable, it can be somewhat limiting. While this isn't a significant issue, the function already leverages gettext filters, so it made sense to use them directly for dynamic translations instead.

wpo-ips-functions.php Show resolved Hide resolved
wpo-ips-functions.php Show resolved Hide resolved
wpo-ips-functions.php Outdated Show resolved Hide resolved
Copy link
Contributor

@MohamadNateqi MohamadNateqi left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@MohamadNateqi MohamadNateqi left a comment

Choose a reason for hiding this comment

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

All good!

wpo-ips-functions.php Show resolved Hide resolved
@alexmigf alexmigf merged commit a4de0e5 into main Jan 24, 2025
6 checks passed
@alexmigf alexmigf deleted the 1027-dynamic-translations-improvement branch January 24, 2025 13:59
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.

Replace translate() with gettext filters for dynamic translations
2 participants