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

# Localization

> Translate Subscribd's components and messages into your application's language

# Localization

Subscribd ships translations for five languages. All component strings, validation messages, and email copy pull from these translation files.

## Supported languages

| Code    | Language             |
| ------- | -------------------- |
| `en`    | English              |
| `es`    | Spanish              |
| `fr`    | French               |
| `de`    | German               |
| `zh-CN` | Chinese (Simplified) |

## Publishing translations

```bash theme={null}
php artisan vendor:publish --tag=subscribd-translations
```

This creates files under `lang/vendor/subscribd/{locale}/` for each language. Edit any file to override individual strings without touching the package source.

## Using a different locale

Subscribd respects Laravel's active locale. Set it in a middleware or controller:

```php theme={null}
app()->setLocale('fr');
```

Or configure the default in `config/app.php`:

```php theme={null}
'locale' => 'fr',
```

## Adding a new language

To add a language not in the shipped list, create the locale directory and copy the English file as a starting point:

```bash theme={null}
mkdir -p lang/vendor/subscribd/it
cp lang/vendor/subscribd/en/subscribd.php lang/vendor/subscribd/it/subscribd.php
```

Then translate the strings in `lang/vendor/subscribd/it/subscribd.php`.

## Translation file structure

```php theme={null}
// lang/vendor/subscribd/en/subscribd.php
return [
    'subscribe'           => 'Subscribe',
    'current_plan'        => 'Current plan',
    'upgrade'             => 'Upgrade',
    'downgrade'           => 'Downgrade',
    'cancel_subscription' => 'Cancel subscription',
    'resume_subscription' => 'Resume subscription',
    'on_grace_period'     => 'Your subscription is canceled and expires on :date.',
    'trial_ends'          => 'Your trial ends in :days days.',
    'invoice_download'    => 'Download PDF',
    'no_invoices'         => 'No invoices yet.',
    'coupon_applied'      => 'Coupon :code applied.',
    'coupon_invalid'      => 'This coupon code is not valid.',
];
```

Parameters like `:date` and `:days` are replaced at runtime by the component.

## Next steps

* **[Livewire Components](/components/livewire)** — Component reference
* **[Blade Components](/components/blade)** — Static component reference
