Add ability for jump to be translated into other languages

This commit is contained in:
Dale Davies
2023-04-06 17:49:27 +01:00
parent 5414f2b644
commit 0c2c320c75
26 changed files with 267 additions and 37 deletions

View File

@@ -20,12 +20,13 @@ require __DIR__ .'/../vendor/autoload.php';
$config = new Jump\Config();
$cache = new Jump\Cache($config);
$language = new Jump\Language($this->config, $this->cache);
// If this script is run via CLI then clear the cache and repopulate it,
// otherwise if run via web then get image data from cache and run this
// script asynchronously to refresh the cache for next time.
if (http_response_code() === false) {
$unsplashdata = Jump\Unsplash::load_cache_unsplash_data($config);
$unsplashdata = Jump\Unsplash::load_cache_unsplash_data($config, $language);
$cache->save(cachename: 'unsplash', data: $unsplashdata);
die('Cached data from Unsplash');
}