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

Refactor: update strings translations (@DAnn2012) #7512

Merged
merged 9 commits into from
Aug 26, 2024
4 changes: 2 additions & 2 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: GiveWP
* Author URI: https://givewp.com/
* Version: 3.15.0
* Version: 3.15.1
* Requires at least: 6.4
* Requires PHP: 7.2
* Text Domain: give
Expand Down Expand Up @@ -406,7 +406,7 @@ private function setup_constants()
{
// Plugin version.
if (!defined('GIVE_VERSION')) {
define('GIVE_VERSION', '3.15.0');
define('GIVE_VERSION', '3.15.1');
}

// Plugin Root File.
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/settings/class-settings-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function get_settings() {
],
],
[
'name' => 'GiveWP Cache',
'name' => __( 'GiveWP Cache', 'give' ),
'id' => 'give-clear-cache',
'buttonTitle' => __( 'Clear Cache', 'give' ),
'desc' => __( 'Click this button if you want to clear GiveWP\'s cache. The plugin stores common settings and queries in cache to optimize performance. Clearing cache will remove and begin rebuilding these saved queries.', 'give' ),
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.2
Stable tag: 3.15.0
Stable tag: 3.15.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -262,6 +262,9 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri
10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on.

== Changelog ==
= 3.15.1: Aug 22nd, 2024 =
* Fix: Resolved an issue with the Akismet integration preventing form submissions when settings are not yet configured

= 3.15.0: Aug 14th, 2024 =
* New: Added Akismet integration support to forms using the visual form builder
* New: Updated the onboarding wizard to create a new form with the visual form builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default function DonationFormsListTable() {
className={`button button-secondary ${styles.button} ${styles.buttonSecondary}`}
onClick={showLegacyDonationForms}
>
{__('Switch to Legacy View')}
{__('Switch to Legacy View', 'give')}
</button>
<a
href={'edit.php?post_type=give_forms&page=givewp-form-builder'}
Expand Down
3 changes: 2 additions & 1 deletion src/DonationSpam/EmailAddressWhiteList.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ class EmailAddressWhiteList
protected $whitelistEmails;

/**
* @since 3.15.1 Add array type to enforce type.
* @since 3.15.0
*/
public function __construct($whitelistEmails = [])
public function __construct(array $whitelistEmails = [])
{
$this->whitelistEmails = $whitelistEmails;
}
Expand Down
6 changes: 5 additions & 1 deletion src/DonationSpam/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ class ServiceProvider implements ServiceProviderInterface
*/
public function register(): void
{
/**
* @since 3.15.1 Case filtered value as an array to enforce type.
* @since 3.15.0
*/
give()->singleton(EmailAddressWhiteList::class, function () {
return new EmailAddressWhiteList(
apply_filters( 'give_akismet_whitelist_emails', give_akismet_get_whitelisted_emails() )
(array) apply_filters( 'give_akismet_whitelist_emails', give_akismet_get_whitelisted_emails() )
);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Donations/DonationsAdminPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private function getForms()
return array_merge([
[
'value' => '0',
'text' => 'Any',
'text' => __('Any', 'give'),
],
], $options);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Donors/DonorsAdminPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function getForms()
return array_merge([
[
'value' => '0',
'text' => 'Any',
'text' => __('Any', 'give'),
],
], $options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export default function EmbedFormModal({handleClose}: EmbedFormModalProps) {
}, []);

const postOptions = [
{label: 'Page', value: 'page'},
{label: 'Post', value: 'post'},
{label: __('Page', 'give'), value: 'page'},
{label: __('Post', 'give'), value: 'post'},
];

const displayStyles = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const RecurringDonationsPromo = () => {
{__('Provide donors the option of making flexible recurring donations.', 'give')}
</div>
<div style={{display: 'flex', justifyContent: 'space-around'}}>
<Button href='https://givewp.com/addons/recurring-donations' target="_blank" rel="noopener noreferrer" variant={'primary'} style={{backgroundColor:'var(--givewp-primary-500)', padding: '4px 8px', height: 'auto'}}>Upgrade your plan</Button>
<Button href='https://givewp.com/addons/recurring-donations' target="_blank" rel="noopener noreferrer" variant={'link'} style={{color: 'var(--givewp-gray-100)'}}>Read more</Button>
<Button href='https://givewp.com/addons/recurring-donations' target="_blank" rel="noopener noreferrer" variant={'primary'} style={{backgroundColor:'var(--givewp-primary-500)', padding: '4px 8px', height: 'auto'}}>{__('Upgrade your plan', 'give')}</Button>
<Button href='https://givewp.com/addons/recurring-donations' target="_blank" rel="noopener noreferrer" variant={'link'} style={{color: 'var(--givewp-gray-100)'}}>{__('Read more', 'give')}</Button>
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const EmailTemplateSettings = ({notification, templateTagsRef, settings, setSett
<PanelRow>
<RadioControl
className="radio-control--email-options"
label={__('Email options', 'givewp')}
label={__('Email options', 'give')}
hideLabelFromVision={true}
selected={option.status ?? 'global'}
options={config.statusOptions}
Expand All @@ -79,17 +79,17 @@ const EmailTemplateSettings = ({notification, templateTagsRef, settings, setSett
>
<PanelRow>
<TextControl
label={__('Email Subject', 'givewp')}
help={__('Enter the email subject line', 'givewp')}
label={__('Email Subject', 'give')}
help={__('Enter the email subject line', 'give')}
onChange={(value) => updateEmailTemplateOption('email_subject', value)}
value={option.email_subject || config.defaultValues.email_subject}
/>
</PanelRow>

<PanelRow>
<TextControl
label={__('Email Header', 'givewp')}
help={__('Enter the email header that appears at the top of the email', 'givewp')}
label={__('Email Header', 'give')}
help={__('Enter the email header that appears at the top of the email', 'give')}
onChange={(value) => updateEmailTemplateOption('email_header', value)}
// @ts-ignore
value={option.email_header || config.defaultValues.email_header}
Expand All @@ -100,12 +100,12 @@ const EmailTemplateSettings = ({notification, templateTagsRef, settings, setSett
<SelectControl
className={'select-control--email-options'}
onChange={(value) => updateEmailTemplateOption('email_content_type', value)}
label={__('Email content type', 'givewp')}
help={__('Choose email type', 'givewp')}
label={__('Email content type', 'give')}
help={__('Choose email type', 'give')}
value={option.email_content_type || config.defaultValues.email_content_type}
options={[
{label: __('HTML', 'givewp'), value: 'text/html'},
{label: __('Plain', 'givewp'), value: 'text/plain'},
{label: __('HTML', 'give'), value: 'text/html'},
{label: __('Plain', 'give'), value: 'text/plain'},
]}
/>
</PanelRow>
Expand Down Expand Up @@ -141,7 +141,7 @@ const EmailTemplateSettings = ({notification, templateTagsRef, settings, setSett
>
{config.supportsRecipients && (
<div className={'email-settings-template__recipient'}>
<BaseControl id={'give-email-template-recipient'} label={__('Email', 'givewp')}>
<BaseControl id={'give-email-template-recipient'} label={__('Email', 'give')}>
{recipients.map((recipientEmail: string, index) => {
return (
<li
Expand Down Expand Up @@ -176,18 +176,18 @@ const EmailTemplateSettings = ({notification, templateTagsRef, settings, setSett
variant={'secondary'}
onClick={() => updateEmailTemplateOption('recipient', [...recipients, ''])}
>
<WPIcon size={17} icon={plus} /> {__('Add email', 'givewp')}
<WPIcon size={17} icon={plus} /> {__('Add email', 'give')}
</Button>
</BaseControl>
</div>
)}
{!config.supportsRecipients && (
<TextControl
disabled={true}
label={__('Email', 'givewp')}
label={__('Email', 'give')}
help={__(
'This email is automatically sent to the individual fundraiser and the recipient cannot be customized.',
'givewp'
'give'
)}
onChange={() => null}
value="{donor_email}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,33 @@ export default function EmailGeneralSettings({ settings, setSettings }) {
>
<PanelRow>
<SelectControl
label={__('Email Template', 'givewp')}
help={__('Choose your template from the available registered template types', 'givewp')}
label={__('Email Template', 'give')}
help={__('Choose your template from the available registered template types', 'give')}
options={[
{label: __('Default template', 'givewp'), value: 'default'},
{label: __('No template, plain text only', 'givewp'), value: 'none'},
{label: __('Default template', 'give'), value: 'default'},
{label: __('No template, plain text only', 'give'), value: 'none'},
]}
value={emailTemplate}
onChange={(emailTemplate) => setSettings({ emailTemplate })}
/>
</PanelRow>
<PanelRow>
<TextControl
label={__('From Name', 'givewp')}
label={__('From Name', 'give')}
help={__(
'The name which appears in the "From" field in all GiveWP donation emails.',
'givewp'
'give'
)}
value={emailFromName}
onChange={(emailFromName) => setSettings({ emailFromName })}
/>
</PanelRow>
<PanelRow>
<TextControl
label={__('From Email', 'givewp')}
label={__('From Email', 'give')}
help={__(
'Email address from which all GiveWP emails are sent from. This will act as the "from" and "reply-to" email address.',
'givewp'
'give'
)}
value={emailFromEmail}
onChange={(emailFromEmail) => setSettings({ emailFromEmail })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const FormSummarySettings = ({settings, setSettings}) => {
<>
<PanelRow>
<TextControl
label={__('Title')}
label={__('Title', 'give')}
value={formTitle}
onChange={(formTitle) => {
!isPublished && setSettings({pageSlug: cleanForSlug(formTitle)});
Expand Down Expand Up @@ -59,7 +59,7 @@ const FormSummarySettings = ({settings, setSettings}) => {
{isExcerptEnabled && (
<PanelRow>
<TextareaControl
label={'Excerpt'}
label={__('Excerpt', 'give')}
help={__(
'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.',
'give'
Expand Down
2 changes: 1 addition & 1 deletion src/FormMigration/FormMetaDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public function isConvertKitEnabled(): bool
$isGloballyEnabled = $this->getMeta('_give_convertkit_override_option') === 'default' &&
give_is_setting_enabled(give_get_option('give_convertkit_show_subscribe_checkbox'));

return $isFormEnabled ? $isGloballyEnabled : $isFormDisabled;
return ! ($isFormDisabled || ( ! $isGloballyEnabled && ! $isFormEnabled));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Subscriptions/SubscriptionsAdminPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function getForms()
return array_merge([
[
'value' => '0',
'text' => 'Any',
'text' => __('Any', 'give'),
]
], $options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function SubscriptionsListTable() {
listTableBlankSlate={ListTableBlankSlate}
>
<button className={tableStyles.addFormButton} onClick={showLegacyDonations}>
{__('Switch to Legacy View')}
{__('Switch to Legacy View', 'give')}
</button>
</ListTablePage>
);
Expand Down
Loading
Loading