Home

srclang

srclang is an HTML attribute used on the track element to declare the language of a text track, such as subtitles or captions. The value is a BCP 47 language tag (for example en, fr, en-US).

The track element associates metadata with media elements; srclang informs user agents, accessibility tools, and search

Example:

<video controls>

<track kind="subtitles" src="subs_en.vtt" srclang="en" label="English">

</video>

In standards, srclang is defined in the HTML5 specification (HTML Living Standard). It is supported by major

engines
about
the
language
of
the
track's
text.
It
is
common
to
pair
srclang
with
label
and
kind
attributes.
The
value
should
be
a
valid
language
tag;
codes
may
include
region
or
script
subtags,
such
as
en-GB,
zh-Hant,
or
fr-CA.
If
omitted,
some
user
agents
may
have
difficulty
presenting
language
choices
reliably.
modern
browsers
and
is
considered
best
practice
for
multilingual
media
to
aid
accessibility,
assistive
technologies,
and
automated
indexing.
While
not
always
strictly
required,
providing
a
correct
srclang
enhances
the
user
experience
by
enabling
accurate
language
selection
and
improving
the
discoverability
of
multilingual
tracks.