Skip to content
Permalink
Browse files

995 fixing language fix on lib pages

  • Loading branch information...
teiling88 committed Oct 30, 2016
1 parent f655013 commit d2c4e6b398d5d07a0b6f45fe1780303a1e7f430f
Showing with 25 additions and 16 deletions.
  1. +13 −4 htdocs/lang/de/ocstyle/main.tpl.php
  2. +12 −12 htdocs/lib2/OcSmarty.class.php
@@ -34,6 +34,13 @@
post_config();
}
$parts = parse_url($_SERVER['REQUEST_URI']);
parse_str($parts['query'], $params);
$langUrl = $parts['path'];
unset($params['locale']);
$params['locale'] = '';
$langUrl .= '?' . http_build_query($params);
require_once $rootpath . 'lib2/smarty/ocplugins/function.season.php';
$sUserCountry = getUserCountry();
@@ -145,10 +152,12 @@ function flashbutton(bname)
<td><strong>{t}Language:{/t}&nbsp;</strong></td>
<td>
<?php
foreach ($opt['template']['locales'] AS $k => $lang) {
if ($lang['status'] == OC_LOCALE_ACTIVE)
echo '<a style="text-decoration: none;" href="index.php?locale=' . $k . '"><img src="' . $lang['flag'] . '" alt="' . $lang['name'] . '" title="' . $lang['name'] . '" width="24px" height="18px" /></a> ';
}
foreach ($opt['template']['locales'] AS $k => $lang) {
if ($lang['status'] == OC_LOCALE_ACTIVE) {
echo '<a style="text-decoration: none;" href="'.$langUrl . $k . '"><img src="' . $lang['flag'] .
'" alt="' . $lang['name'] . '" title="' . $lang['name'] . '" width="24px" height="18px" /></a> ';
}
}
?>
</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{t}Country:{/t}&nbsp;</strong></td>
@@ -1,9 +1,7 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
*
* Inherit Smarty-Class and extend it
***************************************************************************/
@@ -105,8 +103,8 @@ public function __construct()
}
reset($_REQUEST);
if (mb_substr($target, - 1) == '?' || mb_substr($target, - 1) == '&') {
$target = mb_substr($target, 0, - 1);
if (mb_substr($target, -1) == '?' || mb_substr($target, -1) == '&') {
$target = mb_substr($target, 0, -1);
}
$this->target = $target;
@@ -260,18 +258,21 @@ public function display($dummy1 = null, $dummy2 = null, $dummy3 = null)
// build address for switching locales and countries
$base_pageadr = $_SERVER['REQUEST_URI'];
// workaround for http://redmine.opencaching.de/issues/703
$strange_things_pos = strpos($base_pageadr, ".php/");
$strange_things_pos = strpos($base_pageadr, '.php/');
if ($strange_things_pos) {
$base_pageadr = substr($base_pageadr, 0, $strange_things_pos + 4);
}
$lpos = strpos($base_pageadr, "locale=");
$lpos = strpos($base_pageadr, 'locale=');
if ($this->change_country_inpage) {
if (!$lpos) {
$lpos = strpos($base_pageadr, "usercountry=");
$lpos = strpos($base_pageadr, 'usercountry=');
}
if (!$lpos) {
$lpos = strpos($base_pageadr, "country=");
$lpos = strpos($base_pageadr, 'country=');
}
}
if ($lpos) {
@@ -317,7 +318,7 @@ public function display($dummy1 = null, $dummy2 = null, $dummy3 = null)
} else {
$this->assign('sys_dbconnected', false);
}
$this->assign('sys_dbslave', ($db['slave_id'] != - 1));
$this->assign('sys_dbslave', ($db['slave_id'] != -1));
if ($this->template_exists($this->name . '.tpl')) {
$this->assign('template', $this->name);
@@ -405,7 +406,7 @@ public function error($id)
$args = func_get_args();
unset($args[0]);
for ($i = 1; isset($args[$i]); $i ++) {
for ($i = 1; isset($args[$i]); $i++) {
$this->assign('p' . $i, $args[$i]);
}
@@ -418,7 +419,6 @@ public function error($id)
* @param null $dummy1
* @param null $dummy2
* @param null $dummy3
*
* @return bool|false|string
*/
public function is_cached($dummy1 = null, $dummy2 = null, $dummy3 = null)
@@ -585,9 +585,9 @@ public function header()
/**
* - trim target and strip newlines
* - use sDefault if sTarget is absolute and sDefault!=null
*
* @param $sTarget
* @param null $sDefault
*
* @return null|string
*/
public function checkTarget($sTarget, $sDefault = null)

0 comments on commit d2c4e6b

Please sign in to comment.
You can’t perform that action at this time.