Skip Navigation

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

Problem:
The client wants to translate the text added using the CSS "content" property.

Solution:
Sorry, you can’t translate strings from the CSS section/file using the WPML >> String Translation page. However, You can use the ‘:lang’ selector before other selectors to use different CSS for different languages.

Relevant Documentation:
https://www.w3schools.com/cssref/sel_lang.asp

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 2 replies, has 2 voices.

Last updated by basM-3 2 years, 6 months ago.

Assisted by: Noman.

Author Posts
March 9, 2022 at 4:23 pm #10752091

basM-3

Hi,

I added some text with CSS in a filter widget. Is it possible to translate this? I can't find it in the String translation.
I tried changing the _jet_engine_listing_css into “translate” but still couldn't find the word “discover” to translate.

Screenshot 2022-03-09 at 17.19.43.png
Screenshot 2022-03-09 at 17.16.01.png
Screenshot 2022-03-09 at 17.15.15.png
March 10, 2022 at 9:46 am #10757669

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. Sorry, you can’t translate strings from the CSS section/file using WPML >> String Translation page. However, You can use the ‘:lang’ selector before other selectors to use different CSS for different languages. So in this case you may use the CSS below to display different strings in different languages. Please replace below CSS:

.jet-radio-list__label::before {
	content: "discover";
}

With:

:lang(en) .jet-radio-list__label::before {
	content: "discover";
}

:lang(de) .jet-radio-list__label::before {
	content: "DE discover";
}

:lang(fr) .jet-radio-list__label::before {
	content: "FR discover";
}

:lang(nl) .jet-radio-list__label::before {
	content: "NL discover";
}

And update the string.

Here is doc for more details:
hidden link

Please let me know if this resolves your issue or if you need further assistance with this issue.

Thank you

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.