You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
add basic translation interface and default translator
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Prime\Translation;
|
||||
|
||||
final class EchoTranslator implements TranslatorInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function translate($id, $locale = null)
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return 'en';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the PHPFlasher package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Flasher\Prime\Translation;
|
||||
|
||||
interface TranslatorInterface
|
||||
{
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string|null $locale
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function translate($id, $locale = null);
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLocale();
|
||||
}
|
||||
Reference in New Issue
Block a user