-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add translator notes to Gettext strings and update makepot task #618
Conversation
edit: it appears that the GoLF team prefers not having multi-line strings to translate - I can imagine this could become troublesome in their system, especially if those lines change - perhaps we should try to implement the new potfile generator in the same context as this PR -- see https://godaddy.slack.com/archives/C07TDQWJ1/p1695707752498609?thread_ts=1695360403.201719&cid=C07TDQWJ1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, although I would tweak the comments here and there.
@@ -333,18 +338,25 @@ public function process_release_payment( $order ) { | |||
if ( $this->get_gateway()->is_credit_card_gateway() ) { | |||
|
|||
$message = sprintf( | |||
__( '%s %s Pre-Order Release Payment Approved: %s ending in %s (expires %s)', 'woocommerce-plugin-framework' ), | |||
/* translators: Context: A payment is released for a pre-order. Placeholders: %1$s - Payment gateway name, %2$s - Either 'Authorization' or 'Charge' (untranslated), %3$s - Payment method type (e.g. 'PayPal', 'Credit Card', etc.), %4$s - Last four digits of the card or account, %5$s - Expiration date of the payment method */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either 'Authorization' or 'Charge' (untranslated)
Is there a reason why these are untranslated? Perhaps something that was simply initially missed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure unfortunately, and I don't know if there's any legal requirement to keep them as such
...merce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php
Outdated
Show resolved
Hide resolved
...merce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php
Outdated
Show resolved
Hide resolved
@unfulvio-godaddy with GoLF integration in place, this should already be done for us with GitHub Actions. It looks like the actions to update and send files to translations have not yet been set up in this repo, though. I'm going to try going through the rest of the setup steps today, to hopefully finish the integration. However, since this is an open-source project, I think your suggestion to switch from |
…ateway-integration-subscriptions.php Co-authored-by: Illimar Tambek (GoDaddy) <77076466+itambek-godaddy@users.noreply.github.com>
Co-authored-by: Illimar Tambek (GoDaddy) <77076466+itambek-godaddy@users.noreply.github.com>
Co-authored-by: Illimar Tambek (GoDaddy) <77076466+itambek-godaddy@users.noreply.github.com>
Co-authored-by: Illimar Tambek (GoDaddy) <77076466+itambek-godaddy@users.noreply.github.com>
…ateway-integration-subscriptions.php Co-authored-by: Illimar Tambek (GoDaddy) <77076466+itambek-godaddy@users.noreply.github.com>
…odaddy-wordpress/wc-plugin-framework into 617/add-gettext-context-to-strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds some translators notes requested on #617 via Slack -- Closes #617
About this item:
This seems to be the output from our potfile builder, not the source, which truncates lines at 80 chars. I could not find an option in https://github.com/cedaro/grunt-wp-i18n/blob/develop/docs/makepot.md to change this.
We should probably switch to https://developer.wordpress.org/cli/commands/i18n/make-pot/ (something that is recommended also on the Grunt project above) as this other tool does not seem to exhibit the problem. I made a quick test from CLI and runs fine. We could do so with this PR and later update Sake to do the same in plugins. This would require the user to have installed WP CLI (or later have scripts that install the dependency to correctly handle the command).
But I could probably reach the translations team and tell to ignore the line breaks.Nope: they want it without line breaks: #618 (comment)I have updated the
makepot
command to switch to WP CLI. I wanted to run a local instance of WP CLI loaded via Composer as dev dependency. However, it turns out that since we bundle Codeception one such dependency already exists and I think it ends up running an older version that doesn't include thei18n
command. So I'm a bit stuck there and opted to use a global WP CLI instance - this means if the person running the script doesn't have WP CLI installed, it will fail.QA
grunt update_translations
: the potfile should be generated via WP CLI without line/breaksNo code change, no tests or changelog needed