Re: AW: Plain string without language tag

On 2017-02-28 13:34, Neubert, Joachim wrote:
> Thanks Sarven, setting lang="" and xml:lang=""  on page level works. 
> 
> Yet, since I have four different language-specific physical pages, I don't want to drop the language setting for the page as a whole - only for the owl:versionInfo property.
> 
> Any ideas?

You can use the lang attributes on any element. Normally the "default"
is on the html-element, but you have the opportunity to specify a
different language on any node and its children. Example:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <body about="" prefix="owl: http://www.w3.org/2002/07/owl# skos:
http://www.w3.org/2004/02/skos/core# schema: http://schema.org/">
    <h1 property="schema:name">Greetings and salutations!</h1>

    <div about="http://zbw.eu/beta/external_identifiers/jel"
typeof="skos:ConceptScheme">
      <span property="skos:prefLabel" lang="de"
xml:lang="de">JEL-Klassifizierung für verknüpfte offene Daten</span>
      <span property="skos:prefLabel" lang="en-ca" xml:lang="en-ca">JEL
Classification for Linked Open Data</span>
      <span property="owl:versionInfo" content="2017-01" lang=""
xml:lang=""></span>
    </div>
  </body>
</html>

That will give:
* "Greetings and salutations!"@en
* "JEL Klassifizierung für Linked Open Data"@de
* "JEL Classification for Linked Open Data"@en-ca
* "2017-01"

You don't have to use both lang="" and xml:lang="", but only if you want
to ensure that the document should be parsable in both HTML and XHTML.
Usually the mimetype that the document is served with dictates that
(text/html or application/xhtml+xml respectively). If this doesn't apply
to your case, you can use one. IIRC, the HTML parser will not complain
if you have xml:lang, but an XHTML parser will probably complain about lang.

I used Google translate for "de" :)

-Sarven
http://csarven.ca/#i

Received on Tuesday, 28 February 2017 13:04:44 UTC