Problem with css attribute selector for lang

Having trouble installing Oxygen? Got a bug to report? Post it all here.
SNO
Posts: 51
Joined: Mon Oct 01, 2012 3:05 pm

Problem with css attribute selector for lang

Post by SNO »

Hi,
When I use an CSS attribute selector like

Code: Select all

*[langcode|="de"] filter:before {
  content: "Filterkriterium: ";
}
The localized text only shows up if I enter lang="de-". If I just enter lang="de" the english text is still displayed.

Is this the correct implementation of the selector?
Explanation from https://developer.mozilla.org/en-US/doc ... _selectors

[attr|=value]
Represents elements with an attribute name of attr whose value can be exactly value or can begin with value immediately followed by a hyphen, - (U+002D). It is often used for language subcode matches.
Best regards
Stefan
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problem with css attribute selector for lang

Post by Radu »

Hi Stefan,

I tested this versus a web browser and you seem to be right, I added an internal issue to fix this. In the meantime maybe you can double the selector and add also a selector which checks for equality:

Code: Select all

*[langcode|="de"] filter:before,  *[langcode="de"] filter:before{
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SNO
Posts: 51
Joined: Mon Oct 01, 2012 3:05 pm

Re: Problem with css attribute selector for lang

Post by SNO »

Hi Radu,
Thank you very much!
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH
julien_lacour
Posts: 483
Joined: Wed Oct 16, 2019 3:47 pm

Re: Problem with css attribute selector for lang

Post by julien_lacour »

Hello,

Starting with Oxygen 23.0 (already available on our website) you can use the "|=" in the CSS Rules.

Regards,
Julien
Post Reply