aboutsummaryrefslogtreecommitdiffstats
path: root/langs.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'langs.inc.php')
-rw-r--r--langs.inc.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/langs.inc.php b/langs.inc.php
index 3a67aa463..c578dd2ee 100644
--- a/langs.inc.php
+++ b/langs.inc.php
@@ -438,21 +438,29 @@ function _lang_load($locale, $domain) { return i18n::_lang_load($locale, $domain
* Do not exit the process.
*
* @param string $locale from which we want to create dictionary
- * @param string $name_of_translation gettext filename
+ * @param mixed $name_of_translation string for one gettext filename or array for more
*
* @return array
*/
function read_translation_file($locale, $name_of_translation)
{
- if($name_of_translation == '../_nav/langs/en') {
- $path_filename = '/_nav/langs/' . $locale . '.po';
+ if(is_array($name_of_translation)) {
+ $dictionary = array();
+ foreach($name_of_translation as $single_filename) {
+ $dictionary = array_merge($dictionary, read_translation_file($locale, $single_filename));
+ }
+ return $dictionary;
} else {
- $path_filename = '/langs/' . $locale . '/' . $name_of_translation . '.po';
- }
- if($locale == 'en') {
- $path_filename .= 't';
+ if ($name_of_translation == '../_nav/langs/en') {
+ $path_filename = '/_nav/langs/' . $locale . '.po';
+ } else {
+ $path_filename = '/langs/' . $locale . '/' . $name_of_translation . '.po';
+ }
+ if ($locale == 'en') {
+ $path_filename .= 't';
+ }
+ return phpmo_parse_po_file(G_APP_ROOT . $path_filename);
}
- return phpmo_parse_po_file(G_APP_ROOT . $path_filename);
}
/**