Skip Navigation

[Resuelto] How to translate text in a view

This support ticket is created hace 3 años. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Este tema contiene 5 respuestas, tiene 2 mensajes.

Última actualización por fred-r.M hace 3 años.

Asistido por: Jamal.

Autor
Mensajes
#2209417

Tell us what you are trying to do? I do have this code in a view:

<p class="mymeals"><i class="fal fa-utensils-alt" title="Included meals: B = Breakfast | L = Lunch | D = Dinner"></i> <em>[types field="meals"][/types]</em></p>

And I like to translate "Included meals: B = Breakfast | L = Lunch | D = Dinner."

Is there any documentation that you are following? I didn't found anything

Is there a similar example that we can see?

What is the link to your site? enlace oculto and under the tab Program, where I have a title on a small image

#2209445

Additional information, as this is a general issue:

We do have another view, where I need to get text translated:

- Loop item template in Tour Calendar

<div class="g-cols vc_row type_default valign_top mytourcalendarrow">
	<div class="vc_col-sm-2 wpb_column vc_column_container calendarbutton">
		<div class="vc_column-inner">
			<div class="wpb_wrapper">
				<span class="w-btn us-btn-style_5 mycalendarbutton">[types field='tour-date-field' style='text' format='d. M Y'][/types]</span>
			</div>
		</div>
	</div>
	<div class="vc_col-sm-8 wpb_column vc_column_container mytourcalendar firstline">
		<div class="vc_column-inner myinnercolumn">
			<div class="wpb_wrapper">
				<p class="mytourtitle">[types field='short-titel' item="@tourid.parent"][/types]</p>
                <p class="mytourduration"> ([types field='tour-days' format='FIELD_VALUE' item='@tourid.parent'][/types] Days / [types field='number-of-tour-nights' format='FIELD_VALUE' item='@tourid.parent'][/types] Nights)</p> <p class="mytourprice"><strong>Rate:</strong> [ts_format_number][types field='tour-price' format='FIELD_VALUE'][/types][/ts_format_number] / <strong>Surcharge:</strong> [ts_format_number][types field='supplement' format='FIELD_VALUE'][/types][/ts_format_number]</p>
			</div>
		</div>
	</div>
	<div class="vc_col-sm-2 wpb_column vc_column_container calendarbutton">
		<div class="vc_column-inner">
			<div class="wpb_wrapper">
				<div class="mycalenderbuttons">
					<a class="w-btn us-btn-style_7 mycalbooknow" href="[wpv-post-url item="@tourid.parent"]"><span class="w-btn-label">Book now</span><span class="ripple-container"></span></a>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="g-cols wpb_row  type_default valign_top vc_inner mytourcalendarrowmobile">
  <div class="vc_col-sm-12 wpb_column vc_column_container">
    <div class="vc_column-inner">
      <div class="wpb_wrapper">
        <div class="mycalendarbuttoncolumn">
			<span class="w-btn us-btn-style_5 mycalendarbutton">[types field='tour-date-field' style='text' format='d/m/Y'][/types]</span>
            <a class="w-btn us-btn-style_7 mycalendarbutton" href="[wpv-post-url item="@tourid.parent"]"><span class="w-btn-label">Book now</span><span class="ripple-container"></span></a>
        </div>
        <div class="mycalendarcontent">
           <p class="mytourtitle">[types field='short-titel' item="@tourid.parent"][/types]</p>
           <p class="mytourduration">([types field='tour-days' format='FIELD_VALUE' item='@tourid.parent'][/types] Days / [types field='number-of-tour-nights' format='FIELD_VALUE' item='@tourid.parent'][/types] Nights)</p>
           <p class="mytourprice"><strong>Rate:</strong> [ts_format_number][types field='tour-price' format='FIELD_VALUE'][/types][/ts_format_number] /</p>
           <p class="mytourprice"><strong>Surcharge:</strong> [ts_format_number][types field='supplement' format='FIELD_VALUE'][/types][/ts_format_number]</p>
        </div>        
	  </div>
	</div>
  </div>
</div>
#2209933

Hello and thank you for contacting Toolset support.

I assume that you are talking about translation in WPML context, right? I mean that you want to translate these strings in WPML, right? Please correct me if I am wrong.

Did you check for the strings in WPML->String Translation? I am sure the strings should appear there.

In the meantime, please check our documentation article on translation https://toolset.com/course-lesson/translating-views-content-templates-archives-and-forms/

Keep in mind that view translation needs to be done through it is parent post. If the view is used on a page, send the page for translation and you will get the strings to translate picked up. If the view is used in a content template, send the content template for translation and the view will be translated too.

If this does not help, allow me temporary access to your website and I'll check this closer. Let me know where I should see this on the front end so I can check it further. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2210087

Dear Jamal

The second part I was able to do with using [wpml-string]. I did got it in the string translation.

But for the first part, where I do have

title="anything to translate"

How I can use the [wpml-string] shortcode?

#2210107

I am not sure if the following code will work, or if it is even expected to work:

<i class="fal fa-utensils-alt" title="[wpml-string]Included meals: B = Breakfast | L = Lunch | D = Dinner[/wpml-string]"></i>

So, I'll need to know more details about your use case to better assist you. Would you allow me temporary access to your website to check this further? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

I believe this icon is inside a view, right?
Is it inside the loop or outside of it?

Assuming it is inside a content template, does it appear on the translation editor?
What translation editors do you use? The classic editor or the advanced editor?

#2210393

My issue is resolved now. Thank you!