From: Fabrixxm Date: Wed, 27 Feb 2013 13:23:00 +0000 (-0500) Subject: load_translation_table: load translation strings from enabled plugins X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cd8346694bb882d0c0bff5b68d8d7aa5d13dab21;p=friendica.git load_translation_table: load translation strings from enabled plugins --- 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