From 151722ea38ee9a0734a628d0dd01d0a8a714a0b1 Mon Sep 17 00:00:00 2001 From: Katharina Bogad Date: Tue, 22 Jun 2021 13:41:25 +0200 Subject: [PATCH] fix grocy locale generation if no data/config.php is present --- buildfiles/generate-locales.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buildfiles/generate-locales.php b/buildfiles/generate-locales.php index 9bbb3073..5711feef 100644 --- a/buildfiles/generate-locales.php +++ b/buildfiles/generate-locales.php @@ -9,7 +9,9 @@ define("GROCY_DATAPATH", __DIR__ . '/../data'); // Load composer dependencies require_once __DIR__ . '/../vendor/autoload.php'; // Load config files -require_once GROCY_DATAPATH . '/config.php'; +if(file_exists(GROCY_DATAPATH . '/config.php')) { + require_once GROCY_DATAPATH . '/config.php'; +} require_once __DIR__ . '/../config-dist.php'; // For not in own config defined values we use the default ones echo "Searching for localizations in " . __DIR__ . '/../localization/* \n'; @@ -27,4 +29,4 @@ foreach($translations as $lang) { $ls = LocalizationService::getInstance($culture, true); $ls->LoadLocalizations(false); file_put_contents(__DIR__ .'/../public/js/locales/grocy/'.$culture.'.json', $ls->GetPoAsJsonString()); -} \ No newline at end of file +}