> ## Documentation Index
> Fetch the complete documentation index at: https://glotctl.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> A fast CLI tool for checking i18n issues in Next.js projects

Glot is a fast Rust-based CLI tool for checking internationalization (i18n) issues in [Next.js](https://nextjs.org/) projects using [next-intl](https://next-intl-docs.vercel.app/). It helps you catch hardcoded text that should use translation functions, find missing translation keys, and identify unused translations.

## Key Features

<CardGroup cols={2}>
  <Card title="Hardcoded Text Detection" icon="magnifying-glass" href="/detection/hardcoded-text">
    Find untranslated text in JSX/TSX files that should use i18n translation
    functions
  </Card>

  <Card title="Missing Key Detection" icon="triangle-exclamation" href="/detection/missing-keys">
    Identify translation keys used in code but missing from your locale files
  </Card>

  <Card title="Unused Key Detection" icon="trash" href="/detection/unused-keys">
    Find translation keys defined in primary locale but never used in code
  </Card>

  <Card title="Orphan Key Detection" icon="broom" href="/detection/orphan-keys">
    Find keys in non-primary locales that don't exist in primary locale
  </Card>

  <Card title="Replica Lag Detection" icon="clock" href="/detection/replica-lag">
    Find keys in primary locale missing from other locales
  </Card>

  <Card title="Untranslated Detection" icon="language" href="/detection/untranslated">
    Detect values identical to primary locale that may need translation
  </Card>

  <Card title="Type Mismatch Detection" icon="exclamation" href="/detection/type-mismatch">
    Detect type conflicts between locales (string vs array) that cause runtime errors
  </Card>

  <Card title="Unresolved Key Detection" icon="question" href="/detection/unresolved-keys">
    Find dynamic keys that cannot be statically analyzed
  </Card>

  <Card title="Multi-language Support" icon="globe">
    Detects text in any language using Unicode alphabetic character detection
  </Card>

  <Card title="AI Integration" icon="robot" href="/agents/mcp">
    MCP server for AI agents like Claude to analyze and fix i18n issues
  </Card>
</CardGroup>

## Scope

Glot is designed specifically for **Next.js** projects using **[next-intl](https://next-intl-docs.vercel.app/)** as the i18n library. It is not a general-purpose i18n linter.

**Supported:**

* Next.js App Router and Pages Router
* next-intl's `useTranslations`, `getTranslations`, `t()`, `t.rich()`, `t.raw()`, `t.markup()`
* TSX/JSX files with `.tsx`, `.jsx`, `.ts`, `.js` extensions
* JSON-based locale files

**Not supported:**

* Other frameworks (Vue, Angular, Svelte, etc.)
* Other i18n libraries (react-intl, i18next, lingui, etc.)
* Non-JSON translation formats (YAML, PO, XLIFF, etc.)

<Tip>
  If your project doesn't use next-intl, glot's hardcoded text detection still works — but translation key analysis (missing, unused, orphan, etc.) requires next-intl patterns.
</Tip>

## Why Glot?

* **Fast**: Built in Rust using the same parser as Next.js (swc)
* **Accurate**: Understands JSX/TSX syntax and next-intl patterns
* **Configurable**: Customize detection rules, ignored patterns, and checked attributes
* **CI-friendly**: Perfect for automated pipelines with exit codes and structured output

## How It Works

Glot parses your TSX/JSX files using the [swc](https://swc.rs/) AST parser (the same parser used by Next.js) and performs static analysis to detect hardcoded text, track translation function usage, and resolve dynamic keys.

For a detailed breakdown of all supported patterns, detection capabilities, and known limitations, see [How Detection Works](/how-it-works).

## Installation

```bash theme={null}
npm install -D glotctl
```

<Note>
  The npm package is `glotctl`, but the CLI command is `glot`.
</Note>

## Quick Example

```bash theme={null}
# Check your project for i18n issues
npx glot check

# Output:
# error: "Submit"  hardcoded-text
#   --> ./src/components/Button.tsx:5:22
#   |
# 5 |     return <button>Submit</button>;
#   |                    ^
#
# ✘ 1 problem (1 error, 0 warnings)
```

## Next Steps

<Card title="Quick Start" icon="rocket" href="/quickstart">
  Install glot and run your first i18n check in 2 minutes
</Card>
