Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
d616a8e8
Commit
d616a8e8
authored
Jan 12, 2017
by
Dominik Hebeler
Browse files
Merge branch '245-confidential-issue' into 'development'
Resolve "dict.cc Kooperation" Closes #245 See merge request
!690
parents
f75c3f01
38af0127
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/MetaGerSearch.php
View file @
d616a8e8
...
...
@@ -165,6 +165,23 @@ class MetaGerSearch extends Controller
}
$mquicktips
=
array_merge
(
$mquicktips
,
$quicktips
);
# Dict.cc Quicktip
$url
=
"http://www.dict.cc/metager.php?s="
.
urlencode
(
$q
);
$decodedResponse
=
json_decode
(
$this
->
get
(
$url
),
true
);
if
(
$decodedResponse
[
"headline"
]
!=
""
&&
$decodedResponse
[
"link"
]
!=
""
)
{
$quicktip
=
[];
$quicktip
[
"title"
]
=
$decodedResponse
[
"headline"
];
$quicktip
[
"URL"
]
=
$decodedResponse
[
"link"
];
$quicktip
[
"summary"
]
=
implode
(
", "
,
$decodedResponse
[
"translations"
]);
$quicktip
[
'gefVon'
]
=
trans
(
'metaGerSearch.quicktips.dictcc.adress'
);
if
(
App
::
isLocale
(
'de'
))
{
array_unshift
(
$mquicktips
,
$quicktip
);
}
else
{
$mquicktips
[]
=
$quicktip
;
}
}
# wussten Sie schon
$file
=
storage_path
()
.
"/app/public/tips.txt"
;
if
(
file_exists
(
$file
))
{
...
...
resources/lang/de/metaGerSearch.php
View file @
d616a8e8
...
...
@@ -2,5 +2,6 @@
return
[
'quicktips.wikipedia.adress'
=>
'aus <a href="https://de.wikipedia.org" target="_blank" rel="noopener">Wikipedia, der freien Enzyklopädie</a>'
,
'quicktips.dictcc.adress'
=>
'aus <a href="https://www.dict.cc/" target="_blank" rel="noopener">dict.cc</a>'
,
'quicktips.tips.title'
=>
'Wussten Sie schon?'
,
];
resources/lang/en/metaGerSearch.php
View file @
d616a8e8
<?php
return
[
"quicktips.wikipedia.adress"
=>
"taken from: <a href=
\"
https://en.wikipedia.org
\"
target=
\"
_blank
\"
rel=
\"
noopener
\"
> Wikipedia, The Free Encyclopedia"
,
"quicktips.tips.title"
=>
"Did you know ?"
];
\ No newline at end of file
"quicktips.wikipedia.adress"
=>
"from <a href=
\"
https://en.wikipedia.org
\"
target=
\"
_blank
\"
rel=
\"
noopener
\"
> Wikipedia, The Free Encyclopedia"
,
"quicktips.dictcc.adress"
=>
'from <a href="https://www.dict.cc/" target="_blank" rel="noopener">dict.cc</a>'
,
"quicktips.tips.title"
=>
"Did you know?"
,
];
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment