Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Preavee's avatar

Translate plans

Hey there, for my project I decided to use Laravel Spark. With the app itself supporting multiple languages it would be weird if the billing plans would be in english only.

Is there any way to translate the plans which are configured in the spark.php config?

Thanks for your help!

1 like
6 replies
kokoshneta's avatar

I’ve never used Spark, but a 30-second search through its documentation gave me this section about Localisation, which leads me to believe that localising billing plans would work roughly the same in Spark as in Laravel itself.

Preavee's avatar

@kokoshneta Thanks for the answer. I know about that section. But poorly no. The plan name itself is not an translation string in the .vue file. So its not using the translation file from the localization section you mentioned.

joshvand's avatar

@preavee not sure if you solved this.

I just realised the solution is really simple. Publish the translation files and then add the text that you use in the config/spark.php plans section into the respective spark translation file.

For example to add a Spanish translation for a short description which is originally in English:

Run php artisan vendor:publish --tag=spark-lang

in the lang/spark/es.json file add "Try our platform with no risk": "Pruebe nuestra plataforma sin riesgo",

Also, the payment screen/popup for Paddle is based on the users browser language and I think Stripe is the same. https://www.paddle.com/help/start/intro-to-paddle/do-you-offer-localised-checkouts https://support.stripe.com/questions/supported-languages-for-stripe-checkout-and-payment-links

2 likes
Preavee's avatar

@joshvand Thanks for your answer. With that publish you can not translate all the words. Poorly things like the plan name are not translateable. (Stuff from the config file for example like the plan name). I stepped away from spark and created my own system. Didn't took as long as i though in the beginning.

joshvand's avatar

@Preavee Hmmm I think everything can be translated. Maybe there was an update recently to fix that. My app's spark page is fully translated from English to Spanish using the above technique.

1 like
pixeline's avatar

I asked the Spark support team and here is their answer:

Yes, you can localize the plan descriptions and features in Laravel Spark. Here's how:

First, publish the Spark language files:

php artisan vendor:publish --tag=spark-lang

Instead of hardcoding the plan descriptions and features in the config/spark.php file, you can use Laravel's translation keys:

'plans' => [
    [
        'name' => trans('plans.standard.name'),
        'short_description' => trans('plans.standard.description'),
        'monthly_id' => 'price_id',
        'yearly_id' => 'price_id',
        'features' => [
            trans('plans.standard.features.1'),
            trans('plans.standard.features.2'),
            trans('plans.standard.features.3'),
        ],
    ],
]

Create translation files for each language in your resources/lang directory with the corresponding translations. Additionally, you can customize the Stripe Checkout page's language by using the checkoutSessionOptions method in your SparkServiceProvider:

Spark::checkoutSessionOptions('user', function ($billable, Plan $plan) {
    return [
        'locale' => $billable->language,
    ];
});

Docs: https://spark.laravel.com/docs/spark-stripe/customization#localization

1 like

Please or to participate in this conversation.