From 0e7b6eff0cafa178d05a8d65586bbce99a0fb3aa Mon Sep 17 00:00:00 2001 From: rjindael Date: Sat, 10 Jun 2023 23:45:50 -0700 Subject: [PATCH] Changes for Kiseki --- src/Dictionary.php | 12 ++++++------ src/dict/{en.php => en_US.php} | 0 src/dict/{es-cl.php => es_CL.php} | 0 src/dict/{fr-ca.php => fr_CA.php} | 0 src/dict/{pt-br.php => pt_BR.php} | 0 src/dict/{ro-md.php => ro_MD.php} | 0 src/dict/{sr-rs.php => sr_RS.php} | 0 src/dict/{zh-tw.php => zh_TW.php} | 0 8 files changed, 6 insertions(+), 6 deletions(-) rename src/dict/{en.php => en_US.php} (100%) rename src/dict/{es-cl.php => es_CL.php} (100%) rename src/dict/{fr-ca.php => fr_CA.php} (100%) rename src/dict/{pt-br.php => pt_BR.php} (100%) rename src/dict/{ro-md.php => ro_MD.php} (100%) rename src/dict/{sr-rs.php => sr_RS.php} (100%) rename src/dict/{zh-tw.php => zh_TW.php} (100%) diff --git a/src/Dictionary.php b/src/Dictionary.php index f2a5f48..16f8578 100644 --- a/src/Dictionary.php +++ b/src/Dictionary.php @@ -22,7 +22,7 @@ class Dictionary { // Get default locale string in laravel project // 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); } @@ -60,8 +60,8 @@ class Dictionary $baseDictPath = $this->getBaseDictPath(); if (is_array($dictionary)) { foreach ($dictionary as $file) { - if (file_exists($baseDictPath.$file.'.php')) { - $dict = include $baseDictPath.$file.'.php'; + if (file_exists($baseDictPath . $file . '.php')) { + $dict = include $baseDictPath . $file . '.php'; $words = array_merge($words, $dict); } else { // if the file isn't in the dict directory, @@ -72,8 +72,8 @@ class Dictionary } // just a single string, not an array } elseif (is_string($dictionary)) { - if (file_exists($baseDictPath.$dictionary.'.php')) { - $dict = include $baseDictPath.$dictionary.'.php'; + if (file_exists($baseDictPath . $dictionary . '.php')) { + $dict = include $baseDictPath . $dictionary . '.php'; $words = array_merge($words, $dict); } else { if (file_exists($dictionary)) { @@ -93,6 +93,6 @@ class Dictionary */ 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/'; } } diff --git a/src/dict/en.php b/src/dict/en_US.php similarity index 100% rename from src/dict/en.php rename to src/dict/en_US.php diff --git a/src/dict/es-cl.php b/src/dict/es_CL.php similarity index 100% rename from src/dict/es-cl.php rename to src/dict/es_CL.php diff --git a/src/dict/fr-ca.php b/src/dict/fr_CA.php similarity index 100% rename from src/dict/fr-ca.php rename to src/dict/fr_CA.php diff --git a/src/dict/pt-br.php b/src/dict/pt_BR.php similarity index 100% rename from src/dict/pt-br.php rename to src/dict/pt_BR.php diff --git a/src/dict/ro-md.php b/src/dict/ro_MD.php similarity index 100% rename from src/dict/ro-md.php rename to src/dict/ro_MD.php diff --git a/src/dict/sr-rs.php b/src/dict/sr_RS.php similarity index 100% rename from src/dict/sr-rs.php rename to src/dict/sr_RS.php diff --git a/src/dict/zh-tw.php b/src/dict/zh_TW.php similarity index 100% rename from src/dict/zh-tw.php rename to src/dict/zh_TW.php