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

Fixed String Translation in some PHP files #240

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

DAnn2012
Copy link
Contributor

Fixed String Translation in some PHP files

DAnn2012 added 29 commits July 21, 2024 10:39
@DAnn2012
Copy link
Contributor Author

Hello @propertyhive

Please could you take a look at this PR of mine?

Thanks.

@@ -250,7 +250,7 @@ public static function output( $post ) {

if (keyword.length < 3)
{
$('#appraisal_search_property_owner_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
$('#appraisal_search_property_owner_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think the space should part of the esc_html__() call. I think it should just pass 'Enter' instead of 'Enter '. Likewise ' more characters...' should pass just 'more characters' (no space and no '...').

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @propertyhive

if you confirm that this is fine, I will make changes to all the other occurrences.

Thanks.

@@ -326,12 +326,12 @@ function viewing_update_selected_properties()
$right_padding = '105px';
}

echo '<a href="' . get_edit_post_link($enquiry_contact_id, '') . '" class="button" style="position:absolute; top:0; right:' . $right_padding . ';">' . __( 'View ' . $enquiry_contact_type, 'propertyhive' ) . '</a>';
echo '<a href="' . get_edit_post_link($enquiry_contact_id, '') . '" class="button" style="position:absolute; top:0; right:' . $right_padding . ';">' . __( 'View ', 'propertyhive' ) . $enquiry_contact_type . '</a>';
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure how it was before was 'wrong'. There are a finite number of contact types and this allows you to translate these also. Otherwise the $enquiry_content_type would remain untranslated if translation is the goal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @propertyhive

Can the value of $enquiry_contact_type be 'Applicant' or 'Contact'? Is that so?

The string 'View Contact' is present among the translatable strings, but the string 'View Applicant' is not.

In any case, I think that a variable inside the __() function, even if the translation is displayed, can create confusion and problems..

What do you think?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants