Changes for Kiseki
This commit is contained in:
parent
a16589ef92
commit
0e7b6eff0c
|
|
@ -22,7 +22,7 @@ class Dictionary
|
||||||
{
|
{
|
||||||
// Get default locale string in laravel project
|
// Get default locale string in laravel project
|
||||||
// and set it as default dictionary
|
// and set it as default dictionary
|
||||||
$locale = Config::has('app.locale') ? Config::get('app.locale') : 'en';
|
$locale = Config::has('app.locale') ? Config::get('app.locale') : 'en_US';
|
||||||
|
|
||||||
$this->setDictionary($dictionary ?: $locale);
|
$this->setDictionary($dictionary ?: $locale);
|
||||||
}
|
}
|
||||||
|
|
@ -60,8 +60,8 @@ class Dictionary
|
||||||
$baseDictPath = $this->getBaseDictPath();
|
$baseDictPath = $this->getBaseDictPath();
|
||||||
if (is_array($dictionary)) {
|
if (is_array($dictionary)) {
|
||||||
foreach ($dictionary as $file) {
|
foreach ($dictionary as $file) {
|
||||||
if (file_exists($baseDictPath.$file.'.php')) {
|
if (file_exists($baseDictPath . $file . '.php')) {
|
||||||
$dict = include $baseDictPath.$file.'.php';
|
$dict = include $baseDictPath . $file . '.php';
|
||||||
$words = array_merge($words, $dict);
|
$words = array_merge($words, $dict);
|
||||||
} else {
|
} else {
|
||||||
// if the file isn't in the dict directory,
|
// if the file isn't in the dict directory,
|
||||||
|
|
@ -72,8 +72,8 @@ class Dictionary
|
||||||
}
|
}
|
||||||
// just a single string, not an array
|
// just a single string, not an array
|
||||||
} elseif (is_string($dictionary)) {
|
} elseif (is_string($dictionary)) {
|
||||||
if (file_exists($baseDictPath.$dictionary.'.php')) {
|
if (file_exists($baseDictPath . $dictionary . '.php')) {
|
||||||
$dict = include $baseDictPath.$dictionary.'.php';
|
$dict = include $baseDictPath . $dictionary . '.php';
|
||||||
$words = array_merge($words, $dict);
|
$words = array_merge($words, $dict);
|
||||||
} else {
|
} else {
|
||||||
if (file_exists($dictionary)) {
|
if (file_exists($dictionary)) {
|
||||||
|
|
@ -93,6 +93,6 @@ class Dictionary
|
||||||
*/
|
*/
|
||||||
protected function getBaseDictPath()
|
protected function getBaseDictPath()
|
||||||
{
|
{
|
||||||
return property_exists($this, 'baseDictPath') ? $this->baseDictPath : __DIR__.DIRECTORY_SEPARATOR.'dict/';
|
return property_exists($this, 'baseDictPath') ? $this->baseDictPath : __DIR__ . DIRECTORY_SEPARATOR . 'dict/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue