Skip to content

Commit

Permalink
Merge ecde555 into e2099b5
Browse files Browse the repository at this point in the history
  • Loading branch information
carakas committed Sep 25, 2019
2 parents e2099b5 + ecde555 commit 93c9450
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Backend/Core/Language/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,15 @@ public static function getWorkingLanguages(): array
*/
public static function setLocale(string $language): void
{
$application = (defined('APPLICATION') && APPLICATION === 'Console') ? 'Backend' : APPLICATION;

// validate file, generate it if needed
if (!is_file(BACKEND_CACHE_PATH . '/Locale/en.json')) {
BackendLocaleModel::buildCache('en', APPLICATION);
BackendLocaleModel::buildCache('en', $application);
}
if (!is_file(BACKEND_CACHE_PATH . '/Locale/' . $language . '.json')) {
// if you use the language in the console act like it is in the backend
BackendLocaleModel::buildCache(
$language,
(!defined('APPLICATION') || APPLICATION === 'Console') ? 'Backend' : APPLICATION
);
BackendLocaleModel::buildCache($language, $application);
}

// store
Expand Down

0 comments on commit 93c9450

Please sign in to comment.