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