# Scopes

> Feature-scoped catalogs let large apps ship the root vocabulary upfront and lazy-load the rest. The scope name is the path key — same on every loader, every locale.

Source: https://ngwr.dev/guides/translations/scopes  
Kind: Service

## Register a scope

Call once per feature, typically from a route resolver or the feature's bootstrap. The scope's catalog auto-reloads on every locale change.

```typescript
// In a feature module / route resolver:
const i18n = inject(WrI18n);
await i18n.registerScope('checkout');

// Static loader: catalog must exist under that key
// HTTP loader: fetched from path interpolated with both {locale} and {scope}
```

## Consume in templates

The pipe and directive both accept a scope; the service takes it as a third arg.

```angular-html
<!-- pipe -->
{{ 'address.zip' | wrT: undefined: 'checkout' }}

<!-- directive -->
<label [wrT]="'address.zip'" [wrTScope]="'checkout'"></label>

<!-- service -->
i18n.t('address.zip', undefined, 'checkout');
```

## HTTP layout

The HTTP loader interpolates `{scope}` and `{locale}` into its path template. `rootPath` is optional — defaults to `path` with an empty `{scope}`.

```typescript
// HTTP loader will request:
//   GET /assets/i18n/checkout/en.json
//   GET /assets/i18n/checkout/ru.json
provideWrI18nHttpLoader({
  path: '/assets/i18n/{scope}/{locale}.json',
  rootPath: '/assets/i18n/{locale}.json',
});
```
