This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by anjaM-5 9 months, 1 week ago.

Assigned support staff: Riffaz.

Author Posts
January 13, 2019 at 11:50 am #3084536

anjaM-5

Hi, could you please help me translate the copyright message, which is written in the .php file in the following form:

<?php if($rentify_option_data['sb-show-footer-copyrights']){?>
<p>
<?php if(isset($rentify_option_data['sb-copyright-text'])&&!empty($rentify_option_data['sb-copyright-text'])) {?>
<?php echo esc_attr($rentify_option_data['sb-copyright-text']); ?>
<?php } ?>
<a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a>.
<?php if(isset($rentify_option_data['sb-after-copyright-text'])&&!empty($rentify_option_data['sb-after-copyright-text'])) {?>
<?php echo esc_attr($rentify_option_data['sb-after-copyright-text']); ?>
<?php } ?>

January 13, 2019 at 12:36 pm #3084588

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for contacting WPML support.

Only the following lines are creating texts.

<?php echo esc_attr($rentify_option_data['sb-copyright-text']); ?>
<a href="<?php echo esc_url(home_url('/')); ?>"><?php __bloginfo('name'); ?></a>.
<?php echo esc_attr($rentify_option_data['sb-after-copyright-text']); ?>

So you have to change them only.
The final code will be

<?php if($rentify_option_data['sb-show-footer-copyrights']){?>
<p>
<?php if(isset($rentify_option_data['sb-copyright-text'])&&!empty($rentify_option_data['sb-copyright-text'])) {?>
<?php echo esc_attr__($rentify_option_data['sb-copyright-text']); ?>
<?php } ?>
<a href="<?php echo esc_url(home_url('/')); ?>"><?php __bloginfo('name'); ?></a>.
<?php if(isset($rentify_option_data['sb-after-copyright-text'])&&!empty($rentify_option_data['sb-after-copyright-text'])) {?>
<?php echo esc_attr__($rentify_option_data['sb-after-copyright-text']); ?>
<?php } ?>

After that please go to WPML > Theme and Plugin localization and scan the theme.
Now you should be able to find these strings in string translation.

Anyhow, it is not recommended to edit such theme files directly.
If this does not work I recommend you to contact the theme author to make the necessary changes.
These code missing the get text function as well.
Please refer:
1. https://wpml.org/faq/language-setup/
2. https://wpml.org/faq/getting-string-translation-to-work/

Regards,
Riffaz.

January 17, 2019 at 5:14 am #3100554

anjaM-5

My issue is resolved now. Thank you!