Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:

The CSS for that color is dynamic and managed with ACF; the admin can pick a color from the dashboard. But it is not working for the second language.

Solution:

It looks like you create an ACF Options page for those CSS settings. Please follow our guide on translating option pages. You should be able to correct this issue by switching to the new PT language.

https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/translating-the-acf-options-page-custom-fields-with-wpml/

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.

This topic contains 3 replies, has 2 voices.

Last updated by Itamar 1 year, 11 months ago.

Assisted by: Itamar.

Author Posts
July 12, 2023 at 10:50 am #14022707

Walter777

Hello,

my default language is English.

I followed this thread to change the /pt-br/ slug to /pt/ for Portuguese:
https://wpml.org/forums/topic/change-code-in-permalink-from-pt-br-to-pt/

So I created a new language with code "pt" (BRA2 in language switcher) and duplicated contente from old "Portuguese, Brazil" (BRA in language switcher) to the new "Portuguese" in Translation Management.

Afterwards I checked the site and most seem to work but I'm having an issue with non-translateble ACF PRO settings used in CSS - such as a background-color - which are not retrived by acf's "get_field" when I browse the site in the new Portuguese (pt) language. They shoud be fetched from default English but NULL is returned instead.

OK:
hidden link
hover mouse on top menu "Piattaforma" and a layer with white background color will appear correctly.

bug:
hidden link
hover mouse on top menu "Platform" and the same layer doesn't have a background color, is transparent.

The css for that color is dynamic and is managed with ACF and the admin can pick a color from dashaboard. I attach a pic to explain with php code and resulting css for the two pages above, one correct, one with empty colors.

Thank you.

acf-header-backgorund-color.jpg
acfml.jpg
bgc2.jpg
bgc1.jpg
July 12, 2023 at 12:05 pm #14023893

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I can see this problem on your site.

It looks like you create an ACF Options page for those CSS settings. Please follow our guide on translating option pages. You should be able to correct this issue by switching to the new PT language.

https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/translating-the-acf-options-page-custom-fields-with-wpml/

Regards,
Itamar.

July 12, 2023 at 3:22 pm #14026561

Walter777

Hi,

yes there is an options interface made with ACF, with fields set to "copy from default language" and fields set to "translatable".

Clicking "Update" in the CSS settings fixed the issue of the topic, thank you.

However I noticed that translatable ACF options have not been duplicated using old PT-BR but it seems they got the value from default EN.

Translation management duplication doesn't take those into consideration? Should I copy them manually?

Thank you

July 13, 2023 at 7:55 am #14029539

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

If you are talking about the ACF options, then yes, you should copy the values manually.

July 13, 2023 at 9:42 am #14030487

Walter777

Ok thanks.
It would be nice if the WPML duplication feature could take into account those translatable ACF options too.