mirror of
https://github.com/archtechx/gloss.git
synced 2025-12-14 20:04:03 +00:00
Initial commit
This commit is contained in:
commit
f73d6e2dce
14 changed files with 838 additions and 0 deletions
40
src/Gloss.php
Normal file
40
src/Gloss.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lean\Gloss;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* 🔍 Gloss ✨ — Brilliant localization for Laravel.
|
||||
*
|
||||
* @method static void key(string $shortKey, string $newKey) Set a key override.
|
||||
* @method static void value(string $shortKey, string $value) Set a value override.
|
||||
* @method static void values(string $shortKey, string $value) Set multiple value overrides.
|
||||
* @method static ?string get($key, $replace = [], $locale = null) Get a translation string.
|
||||
* @method static ?string choice($key, $replace = [], $locale = null) Get a translation according to an integer value.
|
||||
* @method static void extend(string $shortKey, callable(string, callable): string $value) Extend a translation string.
|
||||
*/
|
||||
class Gloss extends Facade
|
||||
{
|
||||
/**
|
||||
* The key used to bind Gloss to the service container.
|
||||
*/
|
||||
public static string $containerKey = 'gloss';
|
||||
|
||||
/**
|
||||
* Should ___() be used as a helper?
|
||||
*/
|
||||
public static bool $underscoreHelper = true;
|
||||
|
||||
/**
|
||||
* Should the Translator instance be replaced by Gloss?
|
||||
*/
|
||||
public static bool $shouldReplaceTranslator = false;
|
||||
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return static::$containerKey;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue