Skip Navigation

[Resolved] German and Spanish taxonomy translations are sorting by the English name

This support ticket is created 5 years, 2 months ago. 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.

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: Asia/Karachi (GMT+05:00)

This topic contains 8 replies, has 3 voices.

Last updated by simonM-5 5 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1411289

Hi Wagar/Support

Regarding our recently resolved ticket "[Resolved] Translated Custom Taxonomies show as "No items found" using non-default language".

We have noticed that the German and Spanish translations are sorting by the English name, eg the list

English
German
Spanish

from the taxonomy "other language" is returning in German as

Englisch
Deutsch
Spanisch

Would it be possible to have the taxonomies which are ordered by "name" to return alphabetically in the translated language? ie

Deutsch
Englisch
Spanisch

In other words that the translated names get sorted alphabetically instead of the original English names, eg by adding a language parameter to the custom code or similar?

Kind regards
Simon

#1412659

Dear Simon,

I assume you are using the custom codes in this thread:
https://toolset.com/forums/topic/translated-custom-taxonomies-show-as-no-items-found-using-non-default-language/
There isn't such kind of built-in feature within Toolset.

In your case, since there are only few languages options in taxonomy "OTHER LANGUAGES", you can try to check current post has specific term, then display the terms in custom order manually, see our document:
https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/displaying-taxonomies-conditionally/#specific

section "Checking if a post has a specific term assigned"

#1414469

Hi Luo

Thanks for that, however I don't believe that will resolve our requirement.

The requirement is that the result set of translated terms should appear alphabetically in the language currently being viewed, and not follow the alphabetical order given by the terms in the default English language. From a database point of view, I could imagine that the language could be added as a parameter in the custom code and that the order by statement could be adjusted to included order by language, name or order by name, language or similar.

Wagar wrote the custom code in the snippet. Would it make sense to reassign this ticket to Wagar, since he worked on it before? He also told us he had something similar on a site of his own.

Thanks and best regards
Simon

#1414485

OK, as your request, I assign this ticket to Waqar

#1416129

Hi Simon,

Thank you for waiting and I apologize for the delay in reply.

The use of custom shortcode was suggested for a requirement, where you needed a custom order based on slugs, different from the alphabetical order.
( ref: https://toolset.com/forums/topic/translated-custom-taxonomies-show-as-no-items-found-using-non-default-language/#post-1400761 )

For showing terms in alphabetical order you can use the built-in "wpv-post-taxonomy" shortcode.
( ref: https://toolset.com/forums/topic/translated-custom-taxonomies-show-as-no-items-found-using-non-default-language/#post-1400415 )

In summary, for terms that need to be in alphabetically order, you'll use "wpv-post-taxonomy" shortcode and for a custom order, you can use the "get_terms_custom_order" custom shortcode, ordered by slug.

regards,
Waqar

#1421383

HI Wagar

I will try this out when I get a chance in the coming days before the xmas craziness and let you know if it works for us.

Thanks and regards
Simon

#1421823

Hi Simon,

Feel free to test and let me know if you need any further assistance around this.

Happy holidays and a wonderful new year!

regards,
Waqar

#1423355

Hi Waqar

Firstly, apologies - I have been calling you Wagar and not Waqar!

I tested this with Other Languages and it appears to work perfectly in German. Interestingly, the standard wpv-post-taxonomy does not get the <br> stripped out by Fusion, so I can set separator="<br>" and it is accepted fine.

So I think we can close this ticket now.

I wish you a Happy New Year!

Thanks and regards
Simon

#1423359

My issue is resolved now. Thank you!