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.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Bruno 2 months, 3 weeks ago.

Assigned support staff: Bruno.

Author Posts
July 24, 2019 at 8:35 pm #4277495

toshiroN

Tell us what you are trying to do?
I have a piece of custom code in the navbar. I want to translate it, but it is currently not showing up in the string translation list. How can I make it translation ready? I have read the documentation for gettext in the wordpress codex, but it's too advanced for me to understand. The html of the string I want to translate looks like this:

<form class="form-inline">
<a class="btn btn-primary btn-md nav-cta-btn" id="download-redirect-primary-nav" href="/download-links.html" style="font-weight: 500;">Start Today</a>
</form>

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
hidden link

July 24, 2019 at 9:40 pm #4277609

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us. If you only want to translate the string "Start Today", here is an example:

<form class="form-inline">
    <a class="btn btn-primary btn-md nav-cta-btn" id="download-redirect-primary-nav" href="/download-links.html" style="font-weight: 500;"><?php _e( 'Start Today', 'your-domain' ); ?></a>
</form>

Note this part:

<?php _e( 'Start Today', 'your-domain' ); ?>

After adding this part for translation, you can then click on the WPML > Theme and plugins localization, and then scan the theme/plugin where this string is added.

Please, let me know if I can help with any other questions you may have about it. I'll be happy to help.

Thank you.