Skip to content

Commit

Permalink
If we cant load a translation file, dont bail, just toss a warning an…
Browse files Browse the repository at this point in the history
…d coninue on in english.
  • Loading branch information
kormoc committed Dec 29, 2010
1 parent c6591a2 commit 2d1cae6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions classes/Translate.php
Expand Up @@ -165,11 +165,13 @@ public function load_translation($language = null) {
elseif (file_exists(modules_path.'/'.module.'/lang/English.lang'))
$path = modules_path.'/'.module.'/lang/English.lang';

$file = file_get_contents($path);
$file = @file_get_contents($path);

// Error?
if ($file === false)
trigger_error("Failed to open translation file: $path", FATAL);
if ($file === false) {
trigger_error("Failed to open translation file: $path", ERROR);
return false;
}

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

0 comments on commit 2d1cae6

Please sign in to comment.