Home›Support›English Support›[Resolved] Can't translate taxonomy's base slug and get images from ACF gallery
[Resolved] Can't translate taxonomy's base slug and get images from ACF gallery
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing two issues on their bilingual website with English (EN) as the main language and Bahasa Malaysia (MS) as the secondary language. The first issue was with custom taxonomy slugs not translating correctly in URLs, and the second issue was with ACF gallery images not displaying in the MS language.
Solution: For the first issue: 1. Navigate to WPML -> String Translation. 2. Search for the slug and delete it. 3. Go to Settings -> Permalinks, and resave the page. 4. Clear the site's cache. 5. Go to WPML -> Settings -> Taxonomies Translation section. 6. Translate the slug.
Additionally, the supporter found that the "Taxonomies (acf-taxonomy)" post type was set to be translatable in WPML -> Settings -> Post Type Translation, so they set it to be not translatable and deleted the translated taxonomy posts. The client was advised to translate a taxonomy term and a post belonging to this term and then check the issue on this newly translated term.
Please note that the solution provided might be irrelevant due to being outdated or not applicable to your case. If the issue persists, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket with us.
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.
In my website, I'm using English (EN) as the main language and Bahasa Malaysia (MS) as the secondary. I've followed everything from this link to translate the CPT and Taxonomy names and slugs accordingly https://wpml.org/documentation/getting-started-guide/translating-post-categories-and-custom-taxonomies/. I'm using the setting "Translatable" but tse translation if available or fallback to default language all the custom posts and custom taxonomy. However, I'm experiencing 2 issues right now:
#1a. I have a custom taxonomy for posts called "Writers" and "writer" for its slug. In MS, it is translated to "Penulis" and "penulis" respectively. However, all links are not showing the correct translated slug, even from WPML language menu switching. Oddly enough, if I directly replaced "writer" to "penulis" in the URL, the link works, although the taxonomy name is still incorrectly showing the English version.
#1b. The same is happening when I have a Category term in the URL base. The Category term slug is "articles", translated to "artikel". However, when I'm in the MS language archive, the link is incorrectly showing as "articles" instead or "artikel". However, if I'm on a EN language blog post, then switch to the MS language from WPML language menu, the slug is correctly showing as "artikel".
I don't have any issue translating CPT name and slugs, just experiencing issues translating Taxonomies
#2. On a CPT, I have a ACF gallery image. I can get all the images ID correctly in the EN language in the single post, but in the MS language, I get no images. However, all other text custom fields can be shown correctly.
New threads created by Osama Mersal and linked to this one are listed below:
Thanks for contacting WPML forums support. I'll be glad to help you today.
1) Please try the following steps:
1- Go to WPML-> String Translation
2- Search for the slug and delete it
3- Go to Settings-> Permalinks, and resave the page
4- Clear the site's cache
5- Go to WPML-> Settings-> Taxonomies Translation section
6- Translate the slug
2) We try to keep one issue per ticket in our forum. Continuing with one ticket per issue helps supporters focus on one issue at once and enables other users to find solutions to their questions faster.
I tried the steps, twice, and the slug and the Taxonomy name is still using the primary language.
This part still works: if I directly replaced "writer" to "penulis" in the URL, the link works but the taxonomy name is still incorrectly showing in English .
Thanks for your update. Could you please check if the issue persists in a minimal environment by following these steps?
1- Deactivate all the plugins except WPML CMS, String Translation, ACF, and ACF Multilingual.
2- Switch to a WordPress default theme like Twenty Twenty-one.
If the issue is gone, activate them one by one to see which one is causing an interaction issue.
❌ Please backup your database before performing the above test ❌
I checked the Taxnomies and found that the "Taxonomies (acf-taxonomy)" post type was set to be translatable in WPML-> Settings-> Post Type Translation, so I set it to be not translatable.
Also, I deleted the translated taxonomies posts. (hidden link)
Please translate a taxonomy term and a post belonging to this term. (hidden link)
After that, please check the issue on this newly translated term.
I'm confused. Does this mean I must translate a term in order to have the correct taxonomy's slug displayed as "penulis"?
I was expecting it to work similar to CPT, where the secondary language will use the translated CPT name and slug, but if the CPT post does not have a translated content, it will fallback to its primary language content and slug.
Example:
EN: hidden link
MS: hidden link
Theater's slug is translated to "teater", but the post's slug comes from the EN version.
Can't the taxonomy translation work like CPT in this way?
It is strange then that I can still use the translated slug manually as mentioned in my first post. I would have thought that it might have been some misconfiguration or something.
The taxonomy slug acts differently than the post-type slug. You can test that on an empty WordPress installation.
The fallback in the taxonomies allows you to change the language. If you select other translation preferences, you won't see the language switcher to switch to other languages.