aboutsummaryrefslogtreecommitdiffstats
path: root/langs.inc.php
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2016-06-28 18:33:45 +0200
committerfilip <filip.komar@gmail.com>2016-06-28 18:33:45 +0200
commit919bbda416c2add0463b2ae2fcf5b802f4efd59a (patch)
tree7a91b14f81972daff62cfd9a817f3f91218e6f4d /langs.inc.php
parent80c9f1c7aef4eb6500d7f3f907357cb878df5812 (diff)
downloadwww-919bbda416c2add0463b2ae2fcf5b802f4efd59a.tar
www-919bbda416c2add0463b2ae2fcf5b802f4efd59a.tar.gz
www-919bbda416c2add0463b2ae2fcf5b802f4efd59a.tar.bz2
www-919bbda416c2add0463b2ae2fcf5b802f4efd59a.tar.xz
www-919bbda416c2add0463b2ae2fcf5b802f4efd59a.zip
start with the common footer on some pages
+ separate function for it + separate css for it + expanding i18n function for that purpose (to accept more than one gettext file)
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);
}
/**