Problem with css attribute selector for lang

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
SNO
Posts: 35
Joined: Mon Oct 01, 2012 3:05 pm

Problem with css attribute selector for lang

Post by SNO » Tue Sep 22, 2020 4:43 pm

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: 7150
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problem with css attribute selector for lang

Post by Radu » Tue Sep 22, 2020 4:51 pm

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: 35
Joined: Mon Oct 01, 2012 3:05 pm

Re: Problem with css attribute selector for lang

Post by SNO » Wed Sep 23, 2020 10:00 am

Hi Radu,
Thank you very much!
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH

Post Reply