mirror of
https://github.com/daledavies/jump.git
synced 2026-05-07 19:26:29 +02:00
Add ability for jump to be translated into other languages
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user