Commit 4e636080 authored by Karl's avatar Karl
Browse files

Quicktips zeigen jetzt übersetztes Wetter und Wikipedia. Der Hinweis zu...

Quicktips zeigen jetzt übersetztes Wetter und Wikipedia. Der Hinweis zu Ergebnissprachen wird richtig angezeigt
parent bb868708
......@@ -89,11 +89,7 @@ class MetaGerSearch extends Controller
# Wetter
try {
if (App::isLocale('en')) {
$url = "http://api.openweathermap.org/data/2.5/weather?type=accurate&units=metric&lang=en&q=" . urlencode($q) . "&APPID=" . getenv("openweathermap");
} else {
$url = "http://api.openweathermap.org/data/2.5/weather?type=accurate&units=metric&lang=de&q=" . urlencode($q) . "&APPID=" . getenv("openweathermap");
}
$url = "http://api.openweathermap.org/data/2.5/weather?type=accurate&units=metric&lang=" . APP::getLocale() . "&q=" . urlencode($q) . "&APPID=" . getenv("openweathermap");
$result = json_decode($this->get($url), true);
......@@ -133,11 +129,7 @@ class MetaGerSearch extends Controller
}
# Wikipedia Quicktip
if (App::isLocale('en')) {
$url = "https://en.wikipedia.org/w/api.php?action=opensearch&search=" . urlencode($q) . "&limit=10&namespace=0&format=json&redirects=resolve";
} else {
$url = "https://de.wikipedia.org/w/api.php?action=opensearch&search=" . urlencode($q) . "&limit=10&namespace=0&format=json&redirects=resolve";
}
$url = "https://" . APP::getLocale() . ".wikipedia.org/w/api.php?action=opensearch&search=" . urlencode($q) . "&limit=10&namespace=0&format=json&redirects=resolve";
$decodedResponse = json_decode($this->get($url), true);
if (isset($decodedResponse[1][0]) && isset($decodedResponse[2][0]) && isset($decodedResponse[3][0])) {
$quicktip = [];
......
<?php
return [
"redirect" => "(con desviar)",
"weiter" => "Continuar",
"zurueck" => "Atrás",
"filter" => "Resultados filtraban: <strong>[:filter]</strong>. <a href=\":link\" target=\"_blank\">Desactivar filtro.</a>",
"filter.default" => "Recibís el interfaz del usuario en <strong>:langName</strong>, pero resultados en <strong>TODOS</strong> idiomas. Usan <a href=\"/settings\" target=\"_blank\">anpassen</a> para seleccionar una idioma para los resultados."
];
\ No newline at end of file
"redirect" => "(con desviar)",
"weiter" => "Continuar",
"zurueck" => "Atrás",
"filter" => "Resultados filtraban: <strong>[:filter]</strong>. <a href=\":link\" target=\"_blank\">Desactivar filtro.</a>",
"filter.default" => "Recibís el interfaz del usuario en <strong>:langName</strong>, pero resultados en <strong>TODOS</strong> idiomas. Usan <a href=\"/settings\" target=\"_blank\">adjustar</a> para seleccionar una idioma para los resultados.",
];
......@@ -61,21 +61,17 @@
</div>
@endforeach
<div class="quicktip">
<details>
<summary>
<div class="media">
<div class="media-body">
<div>
@if( Request::input('lang') === "all")
{!! trans('results.filter.default', ['langName' => LaravelLocalization::getSupportedLocales()[LaravelLocalization::getCurrentLocale()]['native']]) !!}
@else
{!! trans('results.filter', ['langName' => LaravelLocalization::getSupportedLocales()[LaravelLocalization::getCurrentLocale()]['native'], 'link' => base64_decode(Request::input('unfilteredLink','')), 'filter' => Request::input('lang')]) !!}
@endif
</div>
</div>
<div class="media">
<div class="media-body">
<div>
@if( Request::input('lang') === "all")
{!! trans('results.filter.default', ['langName' => LaravelLocalization::getSupportedLocales()[LaravelLocalization::getCurrentLocale()]['native']]) !!}
@else
{!! trans('results.filter', ['langName' => LaravelLocalization::getSupportedLocales()[LaravelLocalization::getCurrentLocale()]['native'], 'link' => base64_decode(Request::input('unfilteredLink','')), 'filter' => Request::input('lang')]) !!}
@endif
</div>
</summary>
</details>
</div>
</div>
</div>
<script src="{{ elixir('js/quicktips.js') }}"></script>
</body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment