Configuration

# Multiple packages

One default config, plus per-directory overrides for engines, gems, or packages.

## Why packages

A monorepo or an engine-heavy app often has more than one set of locales: a billing engine that ships to different markets than the host, a gem with its own prompt and glossary. `packages:` lets each location override the defaults it needs while inheriting everything else — so you keep one config file, not one per package.

Most apps never need this; an empty `packages:` (the default) means the whole app uses `defaults`.

## Declaring packages

Each entry has a `path` (relative to the app root) and any keys it overrides. Paths like `locales_dir` and `state_dir` resolve *under* the package path.

```ruby
defaults:
  target_locales: [de, sv]
  context: "Acme, a business application"

packages:
  - path: engines/billing
    context: "the Acme billing engine"
    target_locales: [de]
    quality:
      british_spellings: true
```

## Running against a package

Pass `--package` with the same `path` to scope any command to that package's config, locales, and state.

```ruby
bin/lingo status   --package engines/billing
bin/lingo translate --package engines/billing --locale de
bin/lingo validate --package engines/billing --strict
```

## What's inherited

A package entry is deep-merged onto `defaults`. In the example above, the billing package overrides `context`, narrows `target_locales` to `[de]`, and turns on `quality.british_spellings` — while still inheriting the default `provider`, models, `validators`, and `strict` tiers. You only restate what changes.