Legacy form donation modal should display the correct recurring donation billing description #6519
Labels
keep-fresh
"Keep Fresh" issues should not be marked as stale.
type: bug
Existing functionality is broken
User Story
As a donor in a language other than English, I want to make a recurring donation when the interval is > 1, for a period that not is the default one. The period displayed to the right of the amount displays the default period, not the chosen period.
Details
See https://feedback.givewp.com/bug-reports/p/legacy-form-donation-modal-should-display-the-correct-recurring-donation-billing
Expected Behavior
Example in French: the default is 'Tous les deux mois pendant 8 mois' (Every two months for 8 months). I choose 'an' (year).
Expected message to the right of the amount: 'Tous les deux ans pendant huit ans' (Every two years for 8 years)
Displayed message: 'Tous les deux mois pendant 8 mois'
Issue in give-recurring.js line 144:
the 'recurringPeriod' and 'currentRecurringPeriod' varaibles are English strings, and 'recurringPeriod' doesn't match in the query. We need to translate them.
To fix
In give-recurring-helpers.php: add the function give_recurring_get_pretty_plural_periods()
In give-recurring-scripts.php, initialize 'plural_periods' line 36:
'pretty_periods' => give_recurring_get_default_pretty_periods(),
In give-recurring.js, get this variable, and use it.
The text was updated successfully, but these errors were encountered: