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

Fix dev/core issue-5155: Contribution page help text does not match f… #30000

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

artfulrobot
Copy link
Contributor

Copy link

civibot bot commented Apr 18, 2024

🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷

Introduction for new contributors...
  • If this is your first PR, an admin will greenlight automated testing with the command ok to test or add to whitelist.
  • A series of tests will automatically run. You can see the results at the bottom of this page (if there are any problems, it will include a link to see what went wrong).
  • A demo site will be built where anyone can try out a version of CiviCRM that includes your changes.
  • If this process needs to be repeated, an admin will issue the command test this please to rerun tests and build a new demo site.
  • Before this PR can be merged, it needs to be reviewed. Please keep in mind that reviewers are volunteers, and their response time can vary from a few hours to a few weeks depending on their availability and their knowledge of this particular part of CiviCRM.
  • A great way to speed up this process is to "trade reviews" with someone - find an open PR that you feel able to review, and leave a comment like "I'm reviewing this now, could you please review mine?" (include a link to yours). You don't have to wait for a response to get started (and you don't have to stop at one!) the more you review, the faster this process goes for everyone 😄
  • To ensure that you are credited properly in the final release notes, please add yourself to contributor-key.yml
  • For more information about contributing, see CONTRIBUTING.md.
Quick links for reviewers...

➡️ Online demo of this PR 🔗

@civibot civibot bot added the master label Apr 18, 2024
@demeritcowboy
Copy link
Contributor

I'm not sure what the best solution is but e.g. for paypal it does say "Continue", e.g.: https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment.php#L604

@alifrumin
Copy link
Contributor

I tested this fix and it works for me!

Thank you!!!!

@alifrumin
Copy link
Contributor

Code change seems reasonable too

@artfulrobot
Copy link
Contributor Author

@demeritcowboy "click Continue/Make Payment" ?

@demeritcowboy
Copy link
Contributor

This could become a long conversation. What's funny is right before it assigns the text it knows the button text already:

$this->assign('button', $contributionButtonText);
$this->assign('continueText',
$this->getPaymentProcessorObject()->getText('contributionPageContinueText', [
'is_payment_to_existing' => !empty($this->_ccid),
'amount' => $this->_amount,
])
);
, but changing it to insert it as a %1 isn't as good for translation.

Hmm. I probably shouldn't have said anything... but if it's going to break already translated strings then we should think a little bit.

@aydun
Copy link
Contributor

aydun commented Apr 18, 2024

Irrelevant to the issue, but just noting the PR number - that's a lot of PR's!

@artfulrobot artfulrobot marked this pull request as draft April 18, 2024 15:52
@artfulrobot
Copy link
Contributor Author

but if it's going to break already translated strings then we should think a little bit.

yes, I think so too.

Thing is, I can't close this PR; 2013 looks so shameful in that list with its red icon... 😆 But then again I don't have the energy for one of those long conversations ↑ ...

Marked this draft for now. Will close in a bit if we don't come up with a sensible solution.

@@ -589,7 +589,7 @@ public function getText($context, $params) {
return '';

case 'contributionPageContinueText':
return ts('Click the <strong>Continue</strong> button to proceed with the payment.');
return ts('Click the <strong>Make Contribution</strong> button to proceed with the payment.');
Copy link
Contributor

Choose a reason for hiding this comment

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

How about doing the same if block as in the button text? It duplicates some logic, but they are called right after each other, from the same place, and the params are the same.

        if ($params['amount'] <= 0.0 || (int) $this->_paymentProcessor['billing_mode'] === 4) {
          return ts('Click the <strong>Continue</strong> button to proceed with the payment.');
        }
        if ($params['is_payment_to_existing']) {
          return ts('Click the <strong>Make Payment</strong> button to proceed with the payment.');
        }
        return ts('Click the <strong>Make Contribution</strong> button to proceed with the payment.');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Preach! sounds like idea. I've done that. @alifrumin would you mind testing this again with the latest changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

echo ts('%1', [1 => ts('Yep')]);

@artfulrobot artfulrobot marked this pull request as ready for review April 18, 2024 17:31
@alifrumin
Copy link
Contributor

Looks good to me!

@demeritcowboy
Copy link
Contributor

Thanks all.

@demeritcowboy demeritcowboy merged commit 340c6ef into civicrm:master Apr 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants