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

@@ -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
){}

View File

@@ -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);
}

View File

@@ -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