for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Language
*
* Localization tools.
* @package core
* @author [email protected]
* @version 0.1 * @copyright Caffeina srl - 2015 - http://caffeina.it
*/
class Language extends Dictionary {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
use Module;
protected static $current_lang = 'en';
public static function translate($text,$params=null){
$result = static::get(static::$current_lang.'.'.strtolower($text),$text);
return $params ? Text::render($result) : $result;
}
public static function using($lang){
static::$current_lang = strtolower(trim($lang));
public static function load($lang, $dictfile){
ob_start(); $lang = include($dictfile); ob_end_clean();
static::merge([$lang => $dictfile]);
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.