Skip to main content

Localization

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

Supported languages

CodeLanguage
enEnglish
esSpanish
frFrench
deGerman
zh-CNChinese (Simplified)

Publishing translations

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:
app()->setLocale('fr');
Or configure the default in config/app.php:
'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:
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

// 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