From cd8346694bb882d0c0bff5b68d8d7aa5d13dab21 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Wed, 27 Feb 2013 08:23:00 -0500 Subject: [PATCH] load_translation_table: load translation strings from enabled plugins --- include/pgettext.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/pgettext.php b/include/pgettext.php index 5a0eab0b01..fa1482002a 100644 --- a/include/pgettext.php +++ b/include/pgettext.php @@ -90,12 +90,20 @@ function pop_lang() { if(! function_exists('load_translation_table')) { function load_translation_table($lang) { global $a; - + $a->strings = array(); if(file_exists("view/$lang/strings.php")) { include("view/$lang/strings.php"); } - else - $a->strings = array(); + + // load enabled plugins strings + $plugins = $q("SELECT name FROM addon WHERE installed=1;"); + foreach($plugins as $p) { + $name = $p['name']; + if(file_exists("addon/$name/lang/$lang/strings.php")) { + include("addon/$name/lang/$lang/strings.php"); + } + } + }} // translate string if translation exists