Permalink
Browse files

Clean up PHP warnings

Noticed them while checking my test server
  • Loading branch information...
flodolo committed Dec 28, 2015
1 parent 591d3f3 commit dc219c9c5f004e651824a5cdd9996d5b72e6572d
Showing with 10 additions and 10 deletions.
  1. +1 −8 app/models/mainsearch_glossary.php
  2. +9 −2 app/views/gaia.php
@@ -16,13 +16,6 @@
// Limit results to 200
array_splice($locale1_strings, 200);
// Get the locale results
$results = [];
foreach ($locale1_strings as $key => $str) {
$results[$key] = $tmx_target[$key];
}
$perfect = $imperfect = [];
// We want to test compound words as well, /ex: 'switch to'
@@ -77,7 +70,7 @@ function ($element) use ($word) {
$get_results = function ($arr) use ($tmx_target) {
$results = [];
foreach ($arr as $val) {
if ($tmx_target[$val] != '') {
if (isset($tmx_target[$val]) && $tmx_target[$val] != '') {
$results[$val] = $tmx_target[$val];
}
}
View
@@ -309,16 +309,23 @@ function ($str) {
. '</tr>';
foreach ($common_keys as $key => $val) {
$get_localized_string = function ($id) use ($key, $strings) {
// Avoid warnings if the string is not localized
return isset($strings[$id][$key]) ?
$strings[$id][$key] :
'<em class="error">missing string</em>';
};
if (trim(strtolower($strings[$englishchanges[0] . '-en-US'][$key])) != trim(strtolower($strings[$englishchanges[1] . '-en-US'][$key]))) {
$table .=
'<tr>'
. '<td><span class="celltitle">Key</span><div class="string">' . ShowResults::formatEntity($key) . '</div></td>'
. '<td><span class="celltitle">Gaia' . $repo_one . '</span><div class="string">'
. ShowResults::highlight(Utils::secureText($strings[$englishchanges[0] . '-en-US'][$key]), 'en-US')
. '<br><small>' . Utils::secureText($strings[$englishchanges[0]][$key]) . '</small></div></td>'
. '<br><small>' . $get_localized_string($englishchanges[0]) . '</small></div></td>'
. '<td><span class="celltitle">Gaia' . $repo_two . '</span><div class="string">'
. ShowResults::highlight(Utils::secureText($strings[$englishchanges[1] . '-en-US'][$key]), 'en-US')
. '<br><small>' . Utils::secureText($strings[$englishchanges[1]][$key]) . '</small></div></td>'
. '<br><small>' . $get_localized_string($englishchanges[1]) . '</small></div></td>'
. '</tr>';
}
}

0 comments on commit dc219c9

Please sign in to comment.