Skip to content

Commit 2d1cae6

Browse files
committed
If we cant load a translation file, dont bail, just toss a warning and coninue on in english.
1 parent c6591a2 commit 2d1cae6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

classes/Translate.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,13 @@ public function load_translation($language = null) {
165165
elseif (file_exists(modules_path.'/'.module.'/lang/English.lang'))
166166
$path = modules_path.'/'.module.'/lang/English.lang';
167167

168-
$file = file_get_contents($path);
168+
$file = @file_get_contents($path);
169169

170170
// Error?
171-
if ($file === false)
172-
trigger_error("Failed to open translation file: $path", FATAL);
171+
if ($file === false) {
172+
trigger_error("Failed to open translation file: $path", ERROR);
173+
return false;
174+
}
173175

174176
// Parse the file
175177
foreach (preg_split('/\n(?=\S)/', $file) as $group) {

0 commit comments

Comments
 (0)