misc_pterodactyl-panel/app/Extensions/PhraseAppTranslator.php

32 lines
780 B
PHP
Raw Normal View History

2017-02-02 14:05:33 +00:00
<?php
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
*
2017-09-26 02:43:01 +00:00
* This software is licensed under the terms of the MIT license.
* https://opensource.org/licenses/MIT
2017-02-02 14:05:33 +00:00
*/
namespace Pterodactyl\Extensions;
use Illuminate\Translation\Translator as LaravelTranslator;
class PhraseAppTranslator extends LaravelTranslator
2017-02-02 14:05:33 +00:00
{
/**
* Get the translation for the given key.
*
2017-08-22 03:10:48 +00:00
* @param string $key
* @param array $replace
* @param string|null $locale
* @param bool $fallback
2017-03-19 23:36:50 +00:00
* @return string
2017-02-02 14:05:33 +00:00
*/
public function get($key, array $replace = [], $locale = null, $fallback = true)
{
$key = substr($key, strpos($key, '.') + 1);
2017-02-02 23:08:10 +00:00
2017-02-02 14:05:33 +00:00
return "{{__phrase_${key}__}}";
}
}