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: make all tooltips translatable and unique #3996

Closed
Benunc opened this issue Feb 11, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@Benunc
Copy link
Member

commented Feb 11, 2019

Bug Report

User Story

As a give admin I want to translate/modify both the Title tooltip and the First name tooltip with different text.

Current Behavior

Currently, our text translation snippets can't target the trings independently, because they are identical.

Expected Behavior

I expect the tooltip for Title to be customizable separately from the tooltip for First name.

Bug Type

  • This bug describes functionality that once worked as expected in version X.X.X.
  • This bug describes functionality that never worked as expected.
  • I am not sure whether this functionality ever worked as expected.

Steps to Reproduce

  1. Enable the title field on the front end of the form, and tooltips.
  2. Use this snippet in a custom function to modify Give:
function my_give_name_tooltip_text_switcher( $translations, $text, $domain ) {

	if ( $domain == 'give' && $text == 'We will use this to personalize your account experience.' ) {
		$translations = __( 'Your first name', 'give' );
	}

	return $translations;
}
add_filter( 'gettext', 'my_give_name_tooltip_text_switcher', 10, 3 );
  1. View the form and the tooltip for both Title and First Name.

Possible Solution

change this line's text

<?php echo Give()->tooltips->render_help( __( 'We will use this to personalize your account experience.', 'give' ) ); ?>
to Title is used to personalize your donation record.

Change this line

<?php echo Give()->tooltips->render_help( __( 'We will use this to personalize your account experience.', 'give' ) ); ?>
to First Name is used to personalize your donation record.

Change this line

<?php echo Give()->tooltips->render_help( __( 'We will use this as well to personalize your account experience.', 'give' ) ); ?>
to Last Name is used to personalize your donation record.

Related

Acceptance Criteria

  • ALl three fields in the personal info section are translatable using our gettext functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.