mirror of
https://github.com/daledavies/jump.git
synced 2026-03-06 20:20:46 +01:00
Add ability for jump to be translated into other languages
This commit is contained in:
@@ -19,6 +19,7 @@ abstract class AbstractAPI {
|
||||
protected \Jump\Config $config,
|
||||
protected \Jump\Cache $cache,
|
||||
protected \Nette\Http\Session $session,
|
||||
protected \Jump\Language $language,
|
||||
protected ?array $routeparams
|
||||
){}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class Unsplash extends AbstractAPI {
|
||||
$unsplashdata = $this->cache->load(cachename: 'unsplash');
|
||||
|
||||
if ($unsplashdata == null) {
|
||||
$unsplashdata = \Jump\Unsplash::load_cache_unsplash_data($this->config);
|
||||
$unsplashdata = \Jump\Unsplash::load_cache_unsplash_data($this->config, $this->language);
|
||||
$this->cache->save(cachename: 'unsplash', data: $unsplashdata);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ class Weather extends AbstractAPI {
|
||||
.'?units=' . $units
|
||||
.'&lat=' . trim($latlong[0])
|
||||
.'&lon=' . trim($latlong[1])
|
||||
.'&lang='. substr($this->config->get('language'), 0, 2)
|
||||
.'&appid=' . $this->config->get('owmapikey', false);
|
||||
|
||||
// Use the cache to store/retrieve data, make an md5 hash of latlong so it is not possible
|
||||
|
||||
Reference in New Issue
Block a user