<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/LanguageTag",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription11LanguageTagV"
  },
  "title" : "LanguageTag"
}
-->

# LanguageTag

A wrapper around an IETF language tag.

```
struct LanguageTag
```

## Overview

To learn more about the IETF worldwide standard for language tags, see
[RFC5646](https://tools.ietf.org/html/rfc5646).

## Topics

### Creating a Language Tag

[`init(extendedGraphemeClusterLiteral:)`](/documentation/PackageDescription/LanguageTag/init(extendedGraphemeClusterLiteral:))

[`init(stringLiteral: String)`](/documentation/PackageDescription/LanguageTag/init(stringLiteral:))

Creates an instance initialized to the given value.

[`init(unicodeScalarLiteral:)`](/documentation/PackageDescription/LanguageTag/init(unicodeScalarLiteral:))

[`init?(rawValue: String)`](/documentation/PackageDescription/LanguageTag/init(rawValue:))

Creates a new instance with the specified raw value.

### Describing a Language Tag

[`var description: String`](/documentation/PackageDescription/LanguageTag/description)

A textual representation of the language tag.

### Hashing

  <doc:/documentation/PackageDescription/LanguageTag/hash(into:)>

  <doc:/documentation/PackageDescription/LanguageTag/hashValue>

### Operator Functions

  <doc:/documentation/PackageDescription/LanguageTag/!=(_:_:)>

### Default Implementations

[CustomStringConvertible Implementations](/documentation/PackageDescription/LanguageTag/CustomStringConvertible-Implementations)

[ExpressibleByExtendedGraphemeClusterLiteral Implementations](/documentation/PackageDescription/LanguageTag/ExpressibleByExtendedGraphemeClusterLiteral-Implementations)

[ExpressibleByStringLiteral Implementations](/documentation/PackageDescription/LanguageTag/ExpressibleByStringLiteral-Implementations)

[ExpressibleByUnicodeScalarLiteral Implementations](/documentation/PackageDescription/LanguageTag/ExpressibleByUnicodeScalarLiteral-Implementations)

[RawRepresentable Implementations](/documentation/PackageDescription/LanguageTag/RawRepresentable-Implementations)

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`ExpressibleByUnicodeScalarLiteral`](/documentation/Swift/ExpressibleByUnicodeScalarLiteral)

[`ExpressibleByStringLiteral`](/documentation/Swift/ExpressibleByStringLiteral)

[`Escapable`](/documentation/Swift/Escapable)

[`ExpressibleByExtendedGraphemeClusterLiteral`](/documentation/Swift/ExpressibleByExtendedGraphemeClusterLiteral)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)