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

Last updated by Mihai Apetrei 2 months, 2 weeks ago.

Assigned support staff: Mihai Apetrei.

Author Posts
July 29, 2019 at 10:40 pm

veroniqueD-6

I am trying to: Translate some strings

Link to a page where the issue can be seen: hidden link and hidden link

I expected to see: "Inicio" instead of "Home Page" and "Enviar Comentario" instead of "Send Comment"

Instead, I got: No translation

July 29, 2019 at 11:37 pm #4303839

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 any 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/

Please let me know if you still can't find it and I will be more than happy to take a look!

I will be waiting for your response.

PS: Just a note that I am at the end of my shift at the moment and I will be able to get back to you tomorrow.

If you would prefer to not wait for a ticket response, you can mark this current ticket as resolved and in the process of creating a new ticket, you can select the "Live chat" option (it should be the default method now).

Kind regards,
Mihai Apetrei

July 30, 2019 at 12:18 am #4303931

veroniqueD-6

I'll wait for you. I have tried all those solutions without success. Obviously I'm doing something wrong.

July 30, 2019 at 3:33 pm #4309221

Mihai Apetrei
Supporter

Languages: English (English )

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

Sure, I will be more than happy to help! 🙂

Can you please let me know if you are referring to the strings in the screenshots below?

Please let me know.

Kind regards,
Mihai Apetrei

July 30, 2019 at 4:51 pm #4309805

veroniqueD-6

Hi Mihai. All screenshots but the first one. "Enviar" is already in Spanish. Thanks a lot!

July 31, 2019 at 2:42 pm #4315445

Mihai Apetrei
Supporter

Languages: English (English )

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

Hi and thank you for your patience.

"Send comment" was not translated (I attached a screenshot from inside WPML > String Translation).

However, even if I translated the string, it still doesn't show up on the site.

1. I have noticed that your website’s WP Memory Limit is 40MB. The WP memory limit needs to be increased as the minimum requirement for WPML is 128Mb WP Memory Limit: https://wpml.org/home/minimum-requirements/

❌ Very important: please make a backup of your site (files & database) before following any of the upcoming steps ❌

Please add this to your wp-config.php file to increase WP memory:

/* WP Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Paste it just before:

/* That's all, stop editing! Happy blogging. */

These settings can be limited directly by your hosting provider, so, if that’s the case, I recommend you to contact and ask them to modify them directly. If you can get even higher values It would be great.

Please make sure you have updated the values successfully, You can verify them from WPML >> Support page.

2. We need to increase the MaxInputVars to 50000 - currently, you have them set at 1000.

For this, please try to set this variables in your php.ini:

max_input_vars = 50000;
suhosin.post.max_vars = 50000;
suhosin.request.max_vars = 50000;

You may need to contact your hosting provider to set them.

Please make sure you have updated the values successfully, You can verify them from WPML >> Support page.

3. If the steps above didn't solve the issue, please create a full website backup and then change the theme from the child version to the main version and see if there's any difference.

4. If after you followed the steps above the strings are still not translated, please try this:

- disable all plugins except WPML and its add-ons
- check if the issue is happening again
- if it's not, reactivate your plugins one by one, checking every time if the issue shows up again so that you can understand which plugin is causing that issue

If none of this works, please let me know and we will go through the compatibility-test process.

I will be waiting for your response.

Kind regards,
Mihai

July 31, 2019 at 10:42 pm #4317791

veroniqueD-6

It didn't work. I've found the "Send Comment" button inside the functions.php file. Can we wrap that string with some code to force it to translate?

August 1, 2019 at 2:40 pm #4322815

Mihai Apetrei
Supporter

Languages: English (English )

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

Hi.

Aw, I did not know that the string is added manually inside the PHP code.

Then yes, can you please follow the documentation below:
https://wpml.org/forums/topic/i-need-help-translating-a-snip/#post-4293071

That should solve the issue.

Please let me know if you were able to solve it.

If not, you can give me the piece of code that you found and let's see how we can rewrite it. 🙂

I will be waiting for your answer.

Kind regards,
Mihai

August 1, 2019 at 5:14 pm #4324459

veroniqueD-6

Nope, it didn't work for me. Here is the code:

// Comment form custom submit button.
if ( ! function_exists( 'politician_comment_form_submit_button' ) ) :
function politician_comment_form_submit_button($button) {

$button_text = 'Send Comment';
if ( 'product' == get_post_type() ) { $button_text = 'Send Review'; }

return '<input name="submit" type="submit" class="form-submit-btn" id="submit" value="' . $button_text . '" />';
}
endif;
add_filter('comment_form_submit_button', 'politician_comment_form_submit_button');

August 2, 2019 at 4:19 pm #4331411

Mihai Apetrei
Supporter

Languages: English (English )

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

Hi.

Replace this:

$button_text = 'Send Review';

with this:

$button_text = __('Send Review', 'your-text-domain');

After saving it, please see if you can now find it in WPML > String Translation.

If you don't, you might need to scan the 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/

Please let me know if this solved your issue or if you still need help.

I will be waiting for your response.

Just a note that I won't be working on the weekend so I will be able to get back to you at the beginning of next week.

Kind regards,
Mihai

August 5, 2019 at 3:11 pm #4341565

veroniqueD-6

It worked beautifully. Thanks! Now I'm going to look where's 'Homepage' on the WP templates and I'll get back to you.

August 5, 2019 at 3:44 pm #4341723

Mihai Apetrei
Supporter

Languages: English (English )

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

Ha ha!

That's great to hear! 🙂

Sure, get back to me when you have the path for that other string!

I am assigning the ticket back to you for the moment and I will wait for your response.

Kind regards,
Mihai

The topic ‘[Closed] String Translation’ is closed to new replies.