aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2016-09-18 23:24:03 +0200
committerfilip <filip.komar@gmail.com>2016-09-18 23:24:03 +0200
commitf5520d0bf5ce8b6def8b10656505c85430064dd0 (patch)
tree9da67ab03e82a4efb0fce1e6e6ab843590ca386b
parentaaa78172d8a46be8a1c3d35da13b399027d56b8f (diff)
downloadwww-f5520d0bf5ce8b6def8b10656505c85430064dd0.tar
www-f5520d0bf5ce8b6def8b10656505c85430064dd0.tar.gz
www-f5520d0bf5ce8b6def8b10656505c85430064dd0.tar.bz2
www-f5520d0bf5ce8b6def8b10656505c85430064dd0.tar.xz
www-f5520d0bf5ce8b6def8b10656505c85430064dd0.zip
better handling of invalid language
-rw-r--r--langs/report_tx_git.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/langs/report_tx_git.php b/langs/report_tx_git.php
index 388ae2615..ed5db5b75 100644
--- a/langs/report_tx_git.php
+++ b/langs/report_tx_git.php
@@ -210,7 +210,11 @@ foreach ($tx_resources_info as $tx_resource_info) {
$tx_all_resource_names[] = $tx_resource_name;
}
foreach ($tx_resource_info['statistic'] as $tx_resource_language => $tx_resource_language_stat) {
- $completed = sprintf("%d", $tx_resource_language_stat['completed']);
+ if (array_key_exists('completed', $tx_resource_language_stat)) {
+ $completed = sprintf("%d", $tx_resource_language_stat['completed']);
+ } else {
+ $completed = 0;
+ }
if (!in_array($tx_resource_language, $tx_all_languages)) {
$tx_all_languages[] = $tx_resource_language;
}
@@ -230,8 +234,13 @@ foreach ($tx_resources_info as $tx_resource_info) {
if ($tx_resource_language == $git_resource_language && 'en' != $git_resource_language
&& $tx_resource_name == $git_compare_resource_name) {
- $tx_resource_untrans_in_lang = $tx_resource_language_stat['untranslated_entities'];
- $tx_resource_all_strings_in_lang = $tx_resource_untrans_in_lang + $tx_resource_language_stat['translated_entities'];
+ if (array_key_exists('untranslated_entities', $tx_resource_language_stat)) {
+ $tx_resource_untrans_in_lang = $tx_resource_language_stat['untranslated_entities'];
+ $tx_resource_all_strings_in_lang = $tx_resource_untrans_in_lang + $tx_resource_language_stat['translated_entities'];
+ } else {
+ $tx_resource_untrans_in_lang = 0;
+ $tx_resource_all_strings_in_lang = 0;
+ }
$git_resource_num_of_all_strings = $git_resource_info['num_of_all_strings'];
$git_resource_untrans_in_lang = $git_resource_info['num_of_not_fully_trans'];