# AUR4002

## Error Message

`AUR4002: Expected the i18n key to be a string, but got {{value}} of type {{type}}`

## Description

This error occurs when a non-string value is passed as a translation key. The i18n system expects all translation keys to be strings.

## Common Scenarios

```typescript
// ❌ Wrong: Non-string key
const key = 123;
const translated = i18n.tr(key); // AUR4002

// ❌ Wrong: Undefined/null key
const key = undefined;
const translated = i18n.tr(key); // AUR4002
```

## Solution

```typescript
// ✅ Correct: String key
const key = 'welcome';
const translated = i18n.tr(key);

// ✅ Correct: Convert to string if needed
const numericId = 123;
const key = `item_${numericId}`;
const translated = i18n.tr(key);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aurelia.io/developer-guides/error-messages/4000-to-4002/aur4002.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
