Home › Toolset Professional Support › [Resolved] translate default labels for parametric search
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10: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: Asia/Kolkata (GMT+05:30)
Tagged: Views, Views plugin
This topic contains 17 replies, has 3 voices.
Last updated by kristofG 4 years ago.
Assisted by: Minesh.
I found this old article from 2013 which explains the same issue as we have now https://toolset.com/forums/topic/how-to-translate-default-labels-for-parametric-search/ although Toolset stated it would be fixed in a previous Views version, it seems it has not been fixed.
We need to translate the default label for a taxonomy select
[wpv-control-post-taxonomy taxonomy="vertical-category" type="select" default_label="Select a specialization" url_param="wpv-vertical-category"]
We tried to replace the string with a WPML translatable string, but that messes up the code, even if we replace the inner double quotes with single quotes.
[wpv-control-post-taxonomy taxonomy="vertical-category" type="select" default_label="[wpml-string context="filter" name="filter_vertical_category_select_default_label"]Select a specialization[/wpml-string]" url_param="wpv-vertical-category"]
Hello. Thank you for contacting the Toolset support.
The reference link you shared is too old and not recommended to follow the guidance given with that reference ticket as we have new workflow to translate the view.
Considering you are using the WPML plugin to translate your content:
Have you followed the following doc and steps mentioned with the following doc?
=> https://toolset.com/course-lesson/translating-views-content-templates-archives-and-forms/#translating-views
Hi, I followed the doc you provided, but it does not help me.
Those steps allow me to translate what is inside the Loop Editor like the "Loop Item in xyz" but the strings there are already placed via [wpml-string] so no need to translate the whole Loop.
If you look again at our question, you'll notice we need to translate the default labels inside the Search and Pagination and that type of info does not show up under WPML (it's not a Content Template).
I understand and I know that you want to translate the default label.
Can you please share problem URL where you want to translate the default label and for that search filed you want to translate it as well as access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I've escalated this issue to our next level support, Please hold on for further update.
We just release the new version for Toolset plugins including Views 3.3.3 that should address the issue.
We always recommend running your site with the latest stable release plugin version.
*** Please make a FULL BACKUP of your database and website.***
Could you please update ALL Toolset plugins to it's latest officially released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/
Why can't we no longer update the View plugin via the WP Admin?
This means we have to go through the tedious work of logging in to Toolset account, find download, ...
Also, we are no longer informed about possible updates for the Views plugin.
Can you please fix this?
I have updated the plugin but still don't find that string in the String Translation table.
Did a scan for plugins and themes, but it still doesn't show up.
Hello and our apologies for the late reply. Minesh is on vacation, if you don't mind, I'll continue with you on this ticket.
I logged into your website and made a small update to the view, adding a dot to the string, and saving, then removing it.
The string did appear in String translation as you can see on this screenshot hidden link and I translated it to French for testing. It worked, check this screenshot hidden link
Hi Jamal,
I don't know what I am doing wrong then, it works for the Partners page, but not for the Integrations
hidden link
hidden link
They both use the same shortcode
[wpv-control-post-taxonomy taxonomy="vertical-category" type="select" default_label="Select a department" url_param="wpv-vertical-category"]
but the translation only shows on 1 of the 2 pages.
But when I translate "filter_vertical_category_label" the translated label is visible on both Partners and Integrations page, it's just the default label that cannot be translated on the Integrations page.
Jamal is on Vacation. This is Minesh and let me step in here.
The view that displays the Department filter:
=> hidden link
I've register the default label as given under using [wpml-string] shortcode:
[wpv-control-post-taxonomy taxonomy="vertical-category" type="select" default_label="[wpml-string context='filter' name='filter_vertical_category_select_default_label']Select a department[/wpml-string]" url_param="wpv-vertical-category"]
And then I visit the String Translation page:
=> hidden link
And translated the string. I can see its working now even on Integration page as well.
=> hidden link
I see that your solution works, but could you please explain to me why one short code works in View A but exactly the same shortcode does not work in View B?
[wpv-control-post-taxonomy taxonomy="vertical-category" type="select" default_label="Select a department" url_param="wpv-vertical-category"]
works in Partners View but not in Integrations View.
We very much prefer that shorter code compared to
[wpv-control-post-taxonomy taxonomy="vertical-category" type="select" default_label="[wpml-string context='filter' name='filter_vertical_category_select_default_label']Select a department[/wpml-string]" url_param="wpv-vertical-category"]
.
But apart from us being a bit lazy 🙂 why does the code work in View A but not in View B?
When I file a are issue that default_lable is not get translated and now it gets translated but it seems WPML do not register the same string again that is why we need to register the string using [wpml-string] shortcode and that is why its working now.
I will check by running a test and see whats expected and if issue found I will file it again but for now as your issue is fixed and working you are welcome to mark resolve this ticket.
I just checked by creating two different views with same filter and to the filter I added the same text for default label and when I add the filter it automatically registers the string. Please check the following screenshot:
=> hidden link
The string "Select Gym Type" is added two times one for test view 1 and another for test view 2.
So, its working as expected.
In your case somehow you added the filter before we fixed the default label issue that is why the string is not added to string translation automatically and we have to register it manually.
ok, will soon mark this as solved, but feedback on
"In your case somehow you added the filter before we fixed the default label issue that is why the string is not added to string translation automatically and we have to register it manually."
Both Views were created on the same day, way before the default label issue was fixed. So why does one work and the other doesn't. I still can't understand that. It's exactly the same code, it should work in both views. Or are you saying you can only use the default label once and when you want to use the same shortcode in another view, I'll have to [wpml-string] for the default_label?