aboutsummaryrefslogtreecommitdiffstats
path: root/langs.inc.php
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2017-02-15 21:48:02 +0100
committerfilip <filip.komar@gmail.com>2017-02-15 21:48:02 +0100
commitead3023a21f41b4ca79b777f859feb5b55dc5cd8 (patch)
tree10389e1a49875b14273c505a1ce627e4a821fc8c /langs.inc.php
parente5d10a98f81293a4e95b7ed2ef8e1d491f645b18 (diff)
downloadwww-ead3023a21f41b4ca79b777f859feb5b55dc5cd8.tar
www-ead3023a21f41b4ca79b777f859feb5b55dc5cd8.tar.gz
www-ead3023a21f41b4ca79b777f859feb5b55dc5cd8.tar.bz2
www-ead3023a21f41b4ca79b777f859feb5b55dc5cd8.tar.xz
www-ead3023a21f41b4ca79b777f859feb5b55dc5cd8.zip
handling an eror in case of missing l10n file or it's parsing error
Diffstat (limited to 'langs.inc.php')
-rw-r--r--langs.inc.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/langs.inc.php b/langs.inc.php
index aae94b38c..bd6af3bda 100644
--- a/langs.inc.php
+++ b/langs.inc.php
@@ -471,7 +471,12 @@ function read_translation_file($locale, $name_of_translation)
if ($locale == 'en') {
$path_filename .= 't';
}
- return phpmo_parse_po_file(G_APP_ROOT . $path_filename);
+ $dictionary_from_file = phpmo_parse_po_file(G_APP_ROOT . $path_filename);
+ if (is_array($dictionary_from_file)) {
+ return $dictionary_from_file;
+ } else {
+ return array(); // in case of missing l10n file or it's parsing error
+ }
}
}