Rename many references from native to primary.

This commit is contained in:
James Cole
2025-07-31 20:24:19 +02:00
parent 210bd83bd4
commit 6d3f2bd5e7
59 changed files with 128 additions and 146 deletions

View File

@@ -128,11 +128,11 @@ abstract class Controller extends BaseController
$this->defaultCurrency = null;
// get shown-intro-preference:
if (auth()->check()) {
$this->defaultCurrency = Amount::getNativeCurrency();
$this->defaultCurrency = Amount::getPrimaryCurrency();
$language = Steam::getLanguage();
$locale = Steam::getLocale();
$darkMode = app('preferences')->get('darkMode', 'browser')->data;
$this->convertToNative = Amount::convertToNative();
$this->convertToNative = Amount::convertToPrimary();
$page = $this->getPageName();
$shownDemo = $this->hasSeenDemo();
View::share('language', $language);

View File

@@ -285,8 +285,8 @@ class DebugController extends Controller
'user_count' => User::count(),
'user_flags' => $userFlags,
'user_agent' => $userAgent,
'native' => Amount::getNativeCurrency(),
'convert_to_native' => Amount::convertToNative(),
'native' => Amount::getPrimaryCurrency(),
'convert_to_native' => Amount::convertToPrimary(),
'locale_attempts' => $localeAttempts,
'locale' => Steam::getLocale(),
'language' => Steam::getLanguage(),

View File

@@ -45,8 +45,8 @@ class FrontpageController extends Controller
{
$set = $repository->getPiggyBanks();
$info = [];
$native = Amount::getNativeCurrency();
$convertToNative = Amount::convertToNative();
$native = Amount::getPrimaryCurrency();
$convertToNative = Amount::convertToPrimary();
/** @var PiggyBank $piggyBank */

View File

@@ -120,7 +120,7 @@ class Range
// save some formats:
$monthAndDayFormat = (string) trans('config.month_and_day_js', [], $locale);
$dateTimeFormat = (string) trans('config.date_time_js', [], $locale);
$defaultCurrency = Amount::getNativeCurrency();
$defaultCurrency = Amount::getPrimaryCurrency();
// also format for moment JS:
$madMomentJS = (string) trans('config.month_and_day_moment_js', [], $locale);

View File

@@ -126,7 +126,7 @@ class PiggyBankStoreRequest extends FormRequest
$currencyId = (int) ($data['transaction_currency_id'] ?? 0);
$currency = TransactionCurrency::find($currencyId);
if (null === $currency) {
return Amount::getNativeCurrency();
return Amount::getPrimaryCurrency();
}
return $currency;

View File

@@ -131,7 +131,7 @@ class PiggyBankUpdateRequest extends FormRequest
$currencyId = (int) ($data['transaction_currency_id'] ?? 0);
$currency = TransactionCurrency::find($currencyId);
if (null === $currency) {
return Amount::getNativeCurrency();
return Amount::getPrimaryCurrency();
}
return $currency;