---
title: unknown-link
description: "A linked message of vue-i18n names a key that does not exist."
---

# `unknown-link`

**Error** · A linked message of vue-i18n names a key that does not exist.

`git8n check` fails on this rule.

## Why it matters

vue-i18n writes the text of the key in place of `@:key`. The rule runs with `--syntax vue-i18n` only. A key that no file holds shows the key itself, and vue-i18n warns in the console. The key ends only at a space, `{`, `(`, `)`, `|` or `@`, so in `@:nav.home!` the key is `nav.home!`.

## Invalid

`locales/en/common.json`

```json
{
  "ok": "OK",
  "confirm": "Press @:common.okay"
}
```

`locales/fr/common.json`

```json
{
  "ok": "OK",
  "confirm": "Appuyez sur @:common.okay"
}
```

```text
$ git8n check --source en --syntax vue-i18n
locales/en/common.json
  error    common:confirm links to @:common.okay, which is a key of no file of en.  unknown-link

Read more:
  unknown-link  https://git8n.sakuga.dev/docs/reference/rules/unknown-link.html

1 error, 0 warnings in 2 files (en → fr, 2 keys).
```

## Valid

`locales/en/common.json`

```json
{
  "ok": "OK",
  "confirm": "Press @:common.ok"
}
```

`locales/fr/common.json`

```json
{
  "ok": "OK",
  "confirm": "Appuyez sur @:common.ok"
}
```

```text
$ git8n check --source en --syntax vue-i18n
0 errors, 0 warnings in 2 files (en → fr, 2 keys).
```

## What to do

Name a key of the source: `ok` or `common.ok` for the key `ok` of `common.json`, the same form in every link: `ok` if the application merges the files of a language in one object, `common.ok` if it keeps one object for each file. Put a space or a literal, `{'!'}`, between the key and the text that follows it.

[All the rules](./index.md) · [The command `check`](../cli.md#check)

