['card' => 'images/credit_cards/Test-Visa-Icon.png', 'text' => 'Visa'], 2 => ['card' => 'images/credit_cards/Test-MasterCard-Icon.png', 'text' => 'Master Card'], 4 => ['card' => 'images/credit_cards/Test-AmericanExpress-Icon.png', 'text' => 'American Express'], 8 => ['card' => 'images/credit_cards/Test-Diners-Icon.png', 'text' => 'Diners'], 16 => ['card' => 'images/credit_cards/Test-Discover-Icon.png', 'text' => 'Discover'], ]; define('CREDIT_CARDS', serialize($creditCards)); $cachedTables = [ 'currencies' => 'App\Models\Currency', 'sizes' => 'App\Models\Size', 'industries' => 'App\Models\Industry', 'timezones' => 'App\Models\Timezone', 'dateFormats' => 'App\Models\DateFormat', 'datetimeFormats' => 'App\Models\DatetimeFormat', 'languages' => 'App\Models\Language', 'paymentTypes' => 'App\Models\PaymentType', 'countries' => 'App\Models\Country', 'invoiceDesigns' => 'App\Models\InvoiceDesign', 'invoiceStatus' => 'App\Models\InvoiceStatus', 'frequencies' => 'App\Models\Frequency', 'gateways' => 'App\Models\Gateway', 'gatewayTypes' => 'App\Models\GatewayType', 'fonts' => 'App\Models\Font', 'banks' => 'App\Models\Bank', ]; define('CACHED_TABLES', serialize($cachedTables)); // Fix for mPDF: https://github.com/kartik-v/yii2-mpdf/issues/9 define('_MPDF_TTFONTDATAPATH', storage_path('framework/cache/')); function uctrans($text, $data = []) { $locale = Session::get(SESSION_LOCALE); $text = trans($text, $data); return $locale == 'en' ? ucwords($text) : $text; } function utrans($text, $data = []) { $locale = Session::get(SESSION_LOCALE); $text = trans($text, $data); return $locale == 'en' ? strtoupper($text) : $text; } // optional trans: only return the string if it's translated function otrans($text) { $locale = Session::get(SESSION_LOCALE); if ($locale == 'en') { return trans($text); } else { $string = trans($text); $english = trans($text, [], 'en'); return $string != $english ? $string : ''; } } // include modules in translations function mtrans($entityType, $text = false, $replace = []) { if (! $text) { $text = $entityType; } // check if this has been translated in a module language file if (! Utils::isNinjaProd() && $module = Module::find($entityType)) { $key = "{$module->getLowerName()}::texts.{$text}"; $value = trans($key, $replace); if ($key != $value) { return $value; } } return trans("texts.{$text}"); } }