Skip Navigation

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 7 replies, has 2 voices.

Last updated by Mihai Apetrei 1 year, 5 months ago.

Assigned support staff: Mihai Apetrei.

Author Posts
February 6, 2019 at 5:23 pm #3166930

idaL

I am trying to:
Translate some strings that have been added by a programmer for customizing (and facilitating) the data entry inside of the accommodations / yachts.

Link to a page where the issue can be seen:
Inside of the admin panel (inside of the single accommodations / yachts).

I expected to see:
I was looking for the words to translate but cannot find them (the technical details like "length", "beam", "draft", "engines" etc.)

Instead, I got:
Nothing.

February 6, 2019 at 7:55 pm #3167479

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi and thank you for contacting WPML Support!

I will be happy to help you with this.

The way to translate those strings really depends on how they have been implemented in the code.

1. Can you please let me know if you tried to go to WPML > String Translation and search for of the words in those sentences?

Here is some very helpful documentation on how to use the String Translation plugin:
https://wpml.org/documentation/getting-started-guide/string-translation/

If it's not there, it could help if you scan the plugin/theme that's generating the strings and then go back to WPML > String Translation and see if the strings show up:
https://wpml.org/documentation/getting-started-guide/theme-localization/

2. If you can't find it inside the WPML > String Translation, it might be added as admin text.

This should be the normal process to translate admin texts:
https://wpml.org/documentation/getting-started-guide/translating-theme-options/

If you still can't find it, I will need you to:

1. Tell me where exactly he added that code (folder>file)

2. I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of the site files and database before providing us access.

- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box.

The private box looks like this: hidden link

I will be waiting for your response.

Kind regards,
Mihai Apetrei

February 11, 2019 at 10:22 am #3182051

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi.

I was not able to find the "sails" accommodation. Can you please give me the link for that/

It also seems that the FTP credentials don't work for me. Can you please check them once again and click "Edit" on the post above and add the working FTP credentials?

I was searching for "length" under WPML > String Translation and I could find the ACF field in the screenshot I attached. Is that one of the fields that you want to translate? If yes, have you tried checking the box called "Use my translation"?

I will be waiting for your response.

Kind regards,
Mihai

February 11, 2019 at 10:43 am #3182179

idaL

HI Mihai,
I think we cancelled the "sails" accommodation. The test accommodations are now the three drafts you can find on the list "test1111", "new test" and the other.

I am now able to translate the checkboxes - but they don't appear on the foreign versions of the accommodations... 🙁 how comes??

And concerning the screenshot you sent to me... how can I figure out of those are the items I would like to have translated?

I am attaching some screenshots for letting you know what I mean.
Best regards, Ida

February 11, 2019 at 5:15 pm #3184622

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi.

Thank you for letting me know about the name of the test accommodations.

I will spend some time on this and I will get back to you as soon as I have some feedback.

Kind regards,
Mihai

February 13, 2019 at 6:53 pm #3195832

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi.

I was able to find the accommodations and run a few tests.

1. However, FTP still doesn't work for me.

Can you please check the FTP credentials once again and update them in the post above where you added the WordPress panel credentials? Just click "Edit" on that post and add the working credentials.

2. Can you please ask the developer where exactly and how he added the new custom fields and checkboxes?

I have seen accommodation.php already but I think that is not the only place where he added the code. From what I can see, in the single-accommodation.php file, he is just calling for the values of the custom fields and checkboxes that he declared in another place.

I'm looking forward to your answer!

Kind regards,
Mihai

February 14, 2019 at 11:39 am #3199162

idaL

Hi Mihai,
I inserted the access codes into the free text... maybe this helps? I hope so.

Concerning the customization he made, I am sending the code he used.
I hope this helps.

Technical details:

<section id="description" class="tab-content <?php echo $first_display_tab == 'description' ? 'initial' : ''; ?>">
<article>
<?php
do_action( 'bookyourtravel_show_single_accommodation_description_before' );
BookYourTravel_Theme_Utils::render_field("text-wrap description", "", "", $accommodation_obj->get_description(), esc_html__('General', 'bookyourtravel'), false, false, false);

?>
<h2>Technical Details</h2>

    <?php if (get_field( "length" ) != '') {?>

  • Length: <?php echo get_field( "length" ); ?> m
  • <?php } ?>
    <?php if (get_field( "beam" ) != '') {?>

  • Beam : <?php echo get_field( "beam" ); ?> m
  • <?php } ?>
    <?php if (get_field( "draft" ) != '') {?>

  • Draft : <?php echo get_field( "draft" ); ?> m
  • <?php } ?>
    <?php if (get_field( "built" ) != '') {?>

  • Built : <?php echo get_field( "built" ); ?>
  • <?php } ?>
    <?php if (get_field( "refitting" ) != '') {?>

  • Refitting : <?php echo get_field( "refitting" ); ?>
  • <?php } ?>
    <?php if (get_field( "builder" ) != '') {?>

  • Builder : <?php echo get_field( "builder" ); ?>
  • <?php } ?>
    <?php if (get_field( "naval_architect" ) != '') {?>

  • Naval architect : <?php echo get_field( "naval_architect" ); ?>
  • <?php } ?>
    <?php if (get_field( "flag" ) != '') {?>

  • Flag : <?php echo get_field( "flag" ); ?>
  • <?php } ?>
    <?php if (get_field( "hull_construction" ) != '') {?>

  • Hull construction : <?php echo get_field( "hull_construction" );?>
  • <?php } ?>
    <?php if (get_field( "hull_configuration" ) != '') {?>

  • Hull configuration : <?php echo get_field( "hull_configuration" ); ?>
  • <?php } ?>
    <?php if (get_field( "cabins" ) != '') {?>

  • Cabins : <?php echo get_field( "cabins" ); ?>
  • <?php } ?>
    <?php if (get_field( "guests" ) != '') {?>

  • Guests : <?php echo get_field( "guests" ); ?> crew
  • <?php } ?>
    <?php if (get_field( "engines" ) != '') {?>

  • Engines : <?php echo get_field( "engines" ); ?>
  • <?php } ?>
    <?php if (get_field( "cruising_speed" ) != '') {?>

  • Cruising speed : <?php echo get_field( "cruising_speed" ); ?> knots
  • <?php } ?>
    <?php if (get_field( "max_speed" ) != '') {?>

  • Max. speed : <?php echo get_field( "max_speed" ); ?> knots
  • <?php } ?>
    <?php if (get_field( "fuel_consumption" ) != '') {?>

  • Fuel consumption : <?php echo get_field( "fuel_consumption" ); ?> l / h
  • <?php } ?>

</article>
</section>
<!--//description-->

Water sports, instruments etc.

if (!empty($header_text) && !$container_is_tr){
$ret_val .= sprintf("<h2>%s</h2>", $header_text);

if ($header_text == 'Comfort') {
$ret_val .="<ul style='margin-bottom: 0px;'>";
$colors = get_field('comfort_custom');
if($colors != ""){

foreach ($colors as $color) {
$ret_val .= "

  • ".$color."
  • ";
    }
    $ret_val .="";
    }
    }

    if ($header_text == 'Sails') {
    $ret_val .="<ul style='margin-bottom: 0px;'>";
    $colors1 = get_field('sails_custom');
    if($colors1 != ""){
    foreach ($colors1 as $color1) {
    $ret_val .= "

  • ".$color1."
  • ";
    }
    $ret_val .="";
    }
    }

    if ($header_text == 'Water sports') {
    $ret_val .="<ul style='margin-bottom: 0px;'>";
    $colors2 = get_field('water_toys_custom');

    if($colors2 != ""){
    foreach ($colors2 as $color2) {
    $ret_val .= "

  • ".$color2."
  • ";
    }
    $ret_val .="";
    }
    }
    /**/
    if ($header_text == 'Instruments') {
    $ret_val .="<ul style='margin-bottom: 0px;'>";
    $colors3 = get_field('instruments_custom');

    if($colors3 != ""){
    foreach ($colors3 as $color3) {
    $ret_val .= "

  • ".$color3."
  • ";
    }
    $ret_val .="";
    }
    }

    }

    Best regards, Ida

    February 15, 2019 at 3:21 pm #3205607

    Mihai Apetrei
    Supporter

    Languages: English (English )

    Timezone: Europe/Bucharest (GMT+03:00)

    Hi.

    I spent some time on the site and I was able to see that those custom fields are added through the Advanced Custom Fields plugin.

    What you gave me in the last reply are the PHP calls for those fields but I was interested in finding out where and how the fields were actually created.

    Also, from what I can see on the test yacht below, the fields are already translated for all languages:
    hidden link
    hidden link
    hidden link

    I was also able to find all the fields inside WPML String Translation (attaching screenshot).

    So was this resolved already?

    Please let me know.

    Just a note that I am not working on weekends so I will be able to get back to you on Monday.

    Looking forward for your response.

    Kind regards,
    Mihai