backup: live-stand vor erstem git-deployment
This commit is contained in:
30
mysyde/regionalization/PHPFileRegionalizedTextProvider.php
Normal file
30
mysyde/regionalization/PHPFileRegionalizedTextProvider.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Micha
|
||||
* Date: 13.10.2016
|
||||
* Time: 22:17
|
||||
*/
|
||||
class PHPFileRegionalizedTextProvider implements RegionalizedTextProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $textsArray;
|
||||
|
||||
public function __construct($locale) {
|
||||
$filePath = rtrim(__DIR__,'/') . '/resources/localized_strings.' . $locale . '.php';
|
||||
if (file_exists($filePath) && is_readable($filePath) && is_file($filePath)) {
|
||||
$this->textsArray = include($filePath);
|
||||
}
|
||||
}
|
||||
|
||||
public function getRegionalizedText($name)
|
||||
{
|
||||
return array_key_exists($name,$this->textsArray) ? $this->textsArray[$name] : $name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user