product icon

Language Tag


BCP-47 language tags types and validators.

Always bear in mind that the golden rule is to keep your language tag as short as possible. Only add further subtags to your language tag if they are needed to distinguish the language from something else in the context where your content is used.

#What is a language tag?

A language tag is a code that represents a language. It is used to identify the language of a text or other content. Language tags are defined by the IETF in BCP-47.


Further information on choosing the language tag for your content can be found in the W3C article on choosing language tags.


#How to use

Use this library to validate language tags in your application.

You can import the types to validate language tags in your application:

import { LanguageTag } from "@inlang/language-tag"

myLanguageTag = exampleTag as LanguageTag


You can install the @inlang/cli with this command:

npm install @inlang/language-tag


yarn add @inlang/language-tag