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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c7624e9
Update class-ph-meta-box-viewing-property.php
DAnn2012 Jul 21, 2024
4336c19
Update class-ph-meta-box-offer-property.php
DAnn2012 Jul 21, 2024
0de555a
Update class-ph-meta-box-tenancy-property.php
DAnn2012 Jul 21, 2024
93b709b
Update class-ph-meta-box-property-actions.php
DAnn2012 Jul 21, 2024
848fafe
Update class-ph-meta-box-sale-applicant-solicitor.php
DAnn2012 Jul 21, 2024
001b961
Update class-ph-meta-box-contact-solicitor.php
DAnn2012 Jul 21, 2024
ea840ff
Update class-ph-meta-box-appraisal-property-owner.php
DAnn2012 Jul 21, 2024
a9f741f
Update class-ph-meta-box-contact-actions.php
DAnn2012 Jul 21, 2024
13c0816
Update class-ph-meta-box-offer-applicant.php
DAnn2012 Jul 21, 2024
ae8ac67
Update class-ph-meta-box-enquiry-details.php
DAnn2012 Jul 21, 2024
312d263
Update class-ph-meta-box-viewing-applicant.php
DAnn2012 Jul 21, 2024
2fcd647
Update class-ph-meta-box-sale-property-owner-solicitor.php
DAnn2012 Jul 21, 2024
c4ba329
Update class-ph-meta-box-tenancy-applicant.php
DAnn2012 Jul 21, 2024
d62baa6
Update class-ph-meta-box-offer-property-owner-solicitor.php
DAnn2012 Jul 21, 2024
d3a3d3d
Update class-ph-meta-box-offer-applicant-solicitor.php
DAnn2012 Jul 21, 2024
2615dbd
Update class-ph-meta-box-sale-property.php
DAnn2012 Jul 21, 2024
4b982f2
Update class-ph-meta-box-tenancy-property.php
DAnn2012 Jul 21, 2024
c66c9e2
Update class-ph-meta-box-offer-property.php
DAnn2012 Jul 21, 2024
f25d832
Update class-ph-meta-box-viewing-property.php
DAnn2012 Jul 21, 2024
6d2da54
Update class-ph-meta-box-offer-applicant.php
DAnn2012 Jul 21, 2024
bff61a8
Update class-ph-meta-box-viewing-applicant.php
DAnn2012 Jul 21, 2024
34bce6b
Update class-ph-meta-box-property-actions.php
DAnn2012 Jul 21, 2024
1a58f01
Update class-ph-meta-box-property-actions.php
DAnn2012 Jul 21, 2024
ff97431
Update class-ph-meta-box-contact-actions.php
DAnn2012 Jul 21, 2024
fe7d836
Update class-ph-meta-box-contact-actions.php
DAnn2012 Jul 21, 2024
85cb3b8
Update class-ph-meta-box-contact-actions.php
DAnn2012 Jul 21, 2024
471ced1
Update class-ph-meta-box-property-actions.php
DAnn2012 Jul 21, 2024
8bc00ba
Update class-ph-meta-box-property-actions.php
DAnn2012 Jul 21, 2024
c9a2b6d
Update class-ph-meta-box-enquiry-details.php
DAnn2012 Jul 21, 2024
60c7bbf
Update class-ph-meta-box-appraisal-property-owner.php
DAnn2012 Aug 5, 2024
47fbc5b
Update class-ph-meta-box-sale-property.php
DAnn2012 Sep 1, 2024
b6d9ec6
Update class-ph-meta-box-tenancy-property.php
DAnn2012 Sep 1, 2024
b3007cb
Update class-ph-meta-box-offer-property.php
DAnn2012 Sep 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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>');
$('#appraisal_search_property_owner_results').show();
return false;
}
Expand All @@ -264,7 +264,7 @@ public static function output( $post ) {
{
if (response == '' || response.length == 0)
{
$('#appraisal_search_property_owner_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
$('#appraisal_search_property_owner_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class="button contact-action"
{
$('#success_actions').html('');

$('#success_actions').append('<strong>User login created successfully.</strong><br>This contact can now login using their email address and password.<br><br>');
$('#success_actions').append('<strong><?php echo esc_html__( 'User login created successfully.', 'propertyhive' ); ?></strong><br><?php echo esc_html__( 'This contact can now login using their email address and password.', 'propertyhive' ); ?><br><br>');

$('#action_panel_create_login').stop().fadeOut(300, function()
{
Expand All @@ -387,7 +387,7 @@ class="button contact-action"
}

$(that).attr('disabled', false);
$(that).text('Create Login');
$(that).text('<?php echo __( 'Create Login', 'propertyhive' ); ?>');
});
})

Expand Down Expand Up @@ -424,7 +424,7 @@ class="button contact-action"

if (keyword.length < 3)
{
$('#viewing_search_property_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
$('#viewing_search_property_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
$('#viewing_search_property_results').show();
return false;
}
Expand All @@ -440,7 +440,7 @@ class="button contact-action"
{
if (response == '' || response.length == 0)
{
$('#viewing_search_property_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
$('#viewing_search_property_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down Expand Up @@ -506,7 +506,7 @@ class="button contact-action"

if (keyword.length < 3)
{
$('#viewing_search_negotiator_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
$('#viewing_search_negotiator_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
$('#viewing_search_negotiator_results').show();
return false;
}
Expand All @@ -522,7 +522,7 @@ class="button contact-action"
{
if (response == '' || response.length == 0)
{
$('#viewing_search_negotiator_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
$('#viewing_search_negotiator_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down Expand Up @@ -635,11 +635,11 @@ class="button contact-action"
{
$('#success_actions').html('');

$('#success_actions').append('<a href="' + response.success.viewing.edit_link + '" class="button button-primary" style="width:100%; margin-bottom:5px;">Edit Viewing</a>');
$('#success_actions').append('<a href="' + response.success.viewing.edit_link + '" class="button button-primary" style="width:100%; margin-bottom:5px;"><?php echo esc_html__( 'Edit Viewing', 'propertyhive' ); ?></a>');

for ( var i in response.success.properties )
{
$('#success_actions').append('<a href="' + response.success.properties[i].edit_link + '" class="button button-primary" style="width:100%; margin-bottom:5px;">Edit Property</a>');
$('#success_actions').append('<a href="' + response.success.properties[i].edit_link + '" class="button button-primary" style="width:100%; margin-bottom:5px;"><?php echo esc_html__( 'Edit Property', 'propertyhive' ); ?></a>');
}

$('#action_panel_book_viewing').stop().fadeOut(300, function()
Expand All @@ -649,7 +649,7 @@ class="button contact-action"
}

$(that).attr('disabled', false);
$(that).text('Book Viewing');
$(that).text('<?php echo __( 'Book Viewing', 'propertyhive' ); ?>');
});
});

Expand Down Expand Up @@ -694,7 +694,7 @@ class="button contact-action"

if (keyword.length < 3)
{
$('#offer_search_property_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
$('#offer_search_property_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
$('#offer_search_property_results').show();
return false;
}
Expand All @@ -710,7 +710,7 @@ class="button contact-action"
{
if (response == '' || response.length == 0)
{
$('#offer_search_property_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
$('#offer_search_property_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down Expand Up @@ -803,11 +803,11 @@ class="button contact-action"
{
$('#success_actions').html('');

$('#success_actions').append('<a href="' + response.success.offer.edit_link + '" class="button button-primary" style="width:100%; margin-bottom:5px;">Edit Offer</a>');
$('#success_actions').append('<a href="' + response.success.offer.edit_link + '" class="button button-primary" style="width:100%; margin-bottom:5px;"><?php echo esc_html__( 'Edit Offer', 'propertyhive' ); ?></a>');

for ( var i in response.success.properties )
{
$('#success_actions').append('<a href="' + response.success.properties[i].edit_link + '" class="button button-primary" style="width:100%; margin-bottom:5px;">Edit Property</a>');
$('#success_actions').append('<a href="' + response.success.properties[i].edit_link + '" class="button button-primary" style="width:100%; margin-bottom:5px;"><?php echo esc_html__( 'Edit Property', 'propertyhive' ); ?></a>');
}

$('#action_panel_record_offer').stop().fadeOut(300, function()
Expand All @@ -817,7 +817,7 @@ class="button contact-action"
}

$(that).attr('disabled', false);
$(that).text('Record Offer');
$(that).text('<?php echo __( 'Record Offer', 'propertyhive' ); ?>');
});
});

Expand Down Expand Up @@ -855,7 +855,7 @@ function viewing_update_selected_negotiators()
}
else
{
jQuery('#viewing_selected_negotiators').html('<ul><li><em>Unattended</em></li></ul>');
jQuery('#viewing_selected_negotiators').html('<ul><li><em><?php echo esc_html__( 'Unattended', 'propertyhive' ); ?></em></li></ul>');
jQuery('#viewing_selected_negotiators').show();
}
}
Expand All @@ -882,4 +882,4 @@ function offer_update_selected_properties()
<?php

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static function output( $post ) {

if (keyword.length < 3)
{
$('#search_contact_solicitor_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
$('#search_contact_solicitor_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
$('#search_contact_solicitor_results').show();
return false;
}
Expand All @@ -132,7 +132,7 @@ public static function output( $post ) {
{
if (response == '' || response.length == 0)
{
$('#search_contact_solicitor_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
$('#search_contact_solicitor_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down Expand Up @@ -218,4 +218,4 @@ public static function save( $post_id, $post ) {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function viewing_perform_property_search()

if (keyword.length < 3)
{
jQuery('#viewing_search_property_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
jQuery('#viewing_search_property_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
jQuery('#viewing_search_property_results').show();
return false;
}
Expand All @@ -176,7 +176,7 @@ function viewing_perform_property_search()
{
if (response == '' || response.length == 0)
{
jQuery('#viewing_search_property_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
jQuery('#viewing_search_property_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down Expand Up @@ -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.

}
else
{
?>
<a href="" id="create_contact_from_enquiry_button" class="button" style="position:absolute; top:0; right:0;"><?php echo __( 'Create ' . $enquiry_contact_type, 'propertyhive' ); ?></a>
<a href="" id="create_contact_from_enquiry_button" class="button" style="position:absolute; top:0; right:0;"><?php echo __( 'Create ', 'propertyhive' ) . $enquiry_contact_type; ?></a>

<script>
jQuery(document).ready(function($)
Expand All @@ -343,7 +343,7 @@ function viewing_update_selected_properties()
e.preventDefault();

$(this).attr('disabled', 'disabled');
$(this).html('<?php echo __( 'Creating ' . $enquiry_contact_type . '...', 'propertyhive' ); ?>');
$(this).html('<?php echo __( 'Creating ', 'propertyhive' ) . $enquiry_contact_type . '...'; ?>');

var data = {
action: 'propertyhive_create_contact_from_enquiry',
Expand All @@ -356,14 +356,14 @@ function viewing_update_selected_properties()
if (response.error)
{
$(that).attr('disabled', false);
$(that).html('<?php echo __( 'Create ' . $enquiry_contact_type, 'propertyhive' ); ?>');
$(that).html('<?php echo __( 'Create ', 'propertyhive' ) . $enquiry_contact_type; ?>');
}
if (response.success)
{
$(that).attr('disabled', false);
$(that).addClass('button-primary');
$(that).attr('href', response.success);
$(that).html('<?php echo __( $enquiry_contact_type . ' Created. View Now', 'propertyhive' ); ?>');
$(that).html('<?php echo $enquiry_contact_type . __(' Created. View Now', 'propertyhive' ); ?>');
}
}, 'json');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static function output( $post ) {

if (keyword.length < 3)
{
$('#offer_search_applicant_solicitor_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
$('#offer_search_applicant_solicitor_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
$('#offer_search_applicant_solicitor_results').show();
return false;
}
Expand All @@ -131,7 +131,7 @@ public static function output( $post ) {
{
if (response == '' || response.length == 0)
{
$('#offer_search_applicant_solicitor_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
$('#offer_search_applicant_solicitor_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static function output( $post ) {

<label for="">&nbsp;</label>

<a href="" class="create-offer-applicant button">Create New Applicant</a>
<a href="" class="create-offer-applicant button"><?php echo esc_html__( 'Create New Applicant', 'propertyhive' ); ?></a>

</p>

Expand Down Expand Up @@ -161,7 +161,7 @@ public static function output( $post ) {

<label for="">&nbsp;</label>

<a href="" class="create-offer-applicant-cancel">Cancel and Search Existing Applicants</a>
<a href="" class="create-offer-applicant-cancel"><?php echo esc_html__( 'Cancel and Search Existing Applicants', 'propertyhive' ); ?></a>

</p>

Expand Down Expand Up @@ -232,7 +232,7 @@ public static function output( $post ) {

if (keyword.length < 3)
{
$('#offer_search_applicant_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
$('#offer_search_applicant_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
$('#offer_search_applicant_results').show();
return false;
}
Expand All @@ -247,7 +247,7 @@ public static function output( $post ) {
{
if (response == '' || response.length == 0)
{
$('#offer_search_applicant_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
$('#offer_search_applicant_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static function output( $post ) {

if (keyword.length < 3)
{
$('#offer_search_property_owner_solicitor_results').html('<div style="padding:10px;">Enter ' + (3 - keyword.length ) + ' more characters...</div>');
$('#offer_search_property_owner_solicitor_results').html('<div style="padding:10px;"><?php echo esc_html__( 'Enter ', 'propertyhive' ); ?>' + (3 - keyword.length ) + '<?php echo esc_html__( ' more characters...', 'propertyhive' ); ?></div>');
$('#offer_search_property_owner_solicitor_results').show();
return false;
}
Expand All @@ -131,7 +131,7 @@ public static function output( $post ) {
{
if (response == '' || response.length == 0)
{
$('#offer_search_property_owner_solicitor_results').html('<div style="padding:10px;">No results found for \'' + keyword + '\'</div>');
$('#offer_search_property_owner_solicitor_results').html('<div style="padding:10px;"><?php echo esc_html__( 'No results found for ', 'propertyhive' ); ?>\'' + keyword + '\'</div>');
}
else
{
Expand Down
Loading