Skip to content

Commit

Permalink
Remove translations from Spark script variables
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed Nov 15, 2024
1 parent 256273e commit 724b81e
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/Configuration/ProvidesScriptVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Laravel\Spark\Configuration;

use Laravel\Spark\Spark;
use Laravel\Cashier\Cashier;
use Illuminate\Support\Facades\Auth;
use Laravel\Cashier\Cashier;
use Laravel\Spark\Contracts\InitialFrontendState;
use Laravel\Spark\Spark;

trait ProvidesScriptVariables
{
Expand All @@ -17,7 +17,6 @@ trait ProvidesScriptVariables
public static function scriptVariables()
{
return [
'translations' => static::getTranslations() + ['teams.team' => trans('teams.team'), 'teams.member' => trans('teams.member')],
'cardUpFront' => Spark::needsCardUpFront(),
'collectsBillingAddress' => Spark::collectsBillingAddress(),
'collectsEuropeanVat' => Spark::collectsEuropeanVat(),
Expand Down Expand Up @@ -45,20 +44,4 @@ public static function scriptVariables()
'chargesTeamsPerMember' => Spark::chargesTeamsPerMember(),
];
}

/**
* Get the translation keys from file.
*
* @return array
*/
private static function getTranslations()
{
$translationFile = resource_path('lang/'.app()->getLocale().'.json');

if (! is_readable($translationFile)) {
$translationFile = resource_path('lang/'.app('translator')->getFallback().'.json');
}

return json_decode(file_get_contents($translationFile), true);
}
}

0 comments on commit 724b81e

Please sign in to comment.