0 Пользователей и 1 Гость просматривают эту тему.
  • 29 Ответов
  • 12206 Просмотров
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Доброго всем времени суток.
Пришлось вот сейчас делать сайт с переводом на 5 языков. С сайтом и самим переводом все замечательно, проблема возникла с шапкой. Хочется, чтобы при переключении языка менялась шапка под язык сайта. В похожей теме тут реализовать удалось просто созданием нескольких файлов template.css под каждый язык и добавлением кода в index.php, чтобы вопрос решить. В моем случае дело осложняется тем, что в темплейтах вообще никаким боком ничего про лого не сказано. чтобы сменить логотип, и, соответственно, хедер надо поменять ссылку на файл в двух местах (в index.php прописать название файла и размер в пикселах и в templateDetails.xml точно также название и размер) и плюс в файле params.ini там же в шаблоне нужно добавить в список этот файл). Возможно, кому-нибудь довелось столкнуться с подобным хитрым расположением лого в подобной ситуации? Как можно убедить сайт переключать шапки в зависимости от включенного языка? Возможно ли такое вообще реализовать с такой трехсоставной заменой?

ЗЫ. FAQ читал, поиск юзал, сам уже ситуацию по мере сил обкатывал - не получилось. Вся надежда на более опытных, может быть хотя бы подскажут, куда копать.  *DRINK*
« Последнее редактирование: 16.01.2010, 16:42:41 от Sulpher »
*

Sulpher

  • Живу я здесь
  • 2112
  • 401 / 16
  • Шаблоны и расширения Joomla
Вам нужно выполнить следующие действия:
1. Объявить переменную $curlang в начале шаблона. Например, вставив такой код после тега <head>:
Код
<?php
                $tplurl = JURI::base().'templates/'.$this->template;
$curlang = $document->language;
?>
   $tplurl = JURI::base().'templates/'.$this->template; - вот эта штука нужна для указания путей, можно удалить, но тогда в пути к картинке вписываете жесткий путь. (вашсайт.ру/вашшаблон/картинка.jpg)

2. В теле шаблона вставить следующее условие:
Код

<?php
if ($curlang == 'ru-ru') {
echo '<img src="'.$tplurl.'/images/logo_ru.png" alt="Твоя моя логотипа" />';}
else { echo '<img src="'.$tplurl.'/images/logo_en.png" alt="Your logotype" />'; }
  ?>

Таким образом, мы получаем условие с определением языка и вывода соответствующей картинки, в противном случае вывод дефолтового значения.
Код: php
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Ага, вроде бы уловил, а если языков пять, с украинским дефолтным в код их просто добавлять один за другим, и в else дефолтный?? Вроде

Код
						<?php
if ($curlang == 'ru-ru') {
echo '<img src="'.$tplurl.'/images/logo_ru.jpg" alt="Русский Логотип" />';}
                                                if ($curlang == 'en-gb') {
echo '<img src="'.$tplurl.'/images/logo_en.jpg" alt="English Logo" />';}
                                                if ($curlang == 'de-de') {
echo '<img src="'.$tplurl.'/images/logo_de.jpg" alt="Deutsch Logo" />';}
                                                if ($curlang == 'it-it') {
echo '<img src="'.$tplurl.'/images/logo_it.jpg" alt="Italian Logo" />';}
else { echo '<img src="'.$tplurl.'/images/logo_ua.jpg" alt="Український Логотип" />'; }
  ?>

Или нужно под каждый язык создавать подобный цикл?
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Sulpher, Lex, спасибо огромное, потихоньку что-то начинает вырисовываться. После добавления в тело index.php кода

Код
<?php switch ($this->getlanguage()){
  case 'ru-ru':?>
  <img src="'.$tplurl.'/images/logo_ru.jpg" alt="Русский Логотип" />
  <?php
  break;
  case 'en-gb':?>
  <img src="'.$tplurl.'/images/logo_en.jpg" alt="English Logo" />
  <?php
  break;
  case 'uk-ua':?>
  <img src="'.$tplurl.'/images/logo_ua.jpg" alt="Український Логотип" />
  <?php
  break;
  case 'de-de':?>
  <img src="'.$tplurl.'/images/logo_de.jpg" alt="Deutsch Logo" />
  <?php
  break;
  case 'it-it':?>
  <img src="'.$tplurl.'/images/logo_it.jpg" alt="Italian Logo" />
  <?php
  break;
  default :?>    
  <img src="'.$tplurl.'/images/logo_ua.jpg" alt="Український Логотип" />
  <?php
  break;
  }
  ?>

При переключении языков над хедером выводит названия alt, Український Логотип, Italian Logo, и т.д.,  НО сами картинки не меняются, всегда остается дефолтная украинская, хотя все пять файлов в папке images присутствуют и названия правильные.

С логотипом связано следующее:

В файле index.php

Код
/* Overal template width specified in pixels (for fixed width) or percentage (for fluid width). */
$template_width = $this->params->get("templateWidth", "960px");

/* Path to logo image starting from the Joomla! root folder (! without preceding slash !). */
       $logo_path = $this->params->get("logoPath", "templates/jsn_epic_free/images/logo_ua.jpg");

/* Logo width specified in pixels. */
$logo_width = $this->params->get("logoWidth", "960px");

/* Logo height specified in pixels. */
$logo_height = $this->params->get("logoHeight", "160px");

/* URL where logo image should link to (! without preceding slash !). */
$logo_link = $this->params->get("logoLink", "");

/* Definition whether to enable PNG fix feature for IE6 or not.
   This parameter should be turned off only when there are incompatibility issues. */
$enable_pngfix = ($this->params->get("enablePNGfix", 1) == 1)?"yes":"no"; // yes | no

В файле params.ini:

Код
logoPath=templates/jsn_epic_free/images/logo_ua.jpg
logoWidth=960px
logoHeight=160px
logoLink=index.php

В файле templateDetails.xml:

Код
<param name="logoPath" size="50" type="text" default="templates/jsn_epic_pro/images/logo_ua.jpg" label="Logo Path" description="Path to logo image starting from the Joomla! root folder (! without preceding slash !)"/>
<param name="logoWidth" type="text" default="960px" label="Logo Wdith (px)" description="Logo width specified in pixels"/>
<param name="logoHeight" type="text" default="160px" label="Logo Height (px)" description="Logo height specified in pixels"/>

И пока не поменять все вот эти параметры в трех местах, не меняется лого, он же хедер. А вот как заставить темплейт воспринимать все 5 файлов? 
« Последнее редактирование: 16.01.2010, 02:32:21 от Lex_Amorph »
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
<img src="<?php $tplurl ?>/images/logo_it.jpg" alt="Italian Logo" />   
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
<img src="<?php $tplurl ?>/images/logo_it.jpg" alt="Italian Logo" />   

Исправил, эффект тот же. Выводит alt над хедером, картинку не меняет. http://gulych.com.ua, вот сайт (да не сочтут его рекламой, все равно он только сделан и даже не индексирован еще нигде). Если щелкать по флажкам языков меняется только надпись alt. Черт, мне уже самому даже интересно стало, что за нафиг такой =/
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Поставь код перед </header>/ Подозрение, что код стоит высоко, до инициализации  $tplurl
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Поставь код перед </header>/ Подозрение, что код стоит высоко, до инициализации  $tplurl

Вот весь индекс, если не затруднит, можете глянуть, куда безопасно вставить код, попробовал перед разделом хедера, пишет ошибку
Parse error: syntax error, unexpected '<' in /home/h20082/data/www/gulych.com.ua/templates/jsn_epic_free/index.php on line 79

Код
<?php
/**
* @copyright Copyright (C) 2006 - 2008 JoomlaShine.com
* @author JoomlaShine.com
* @license Creative Commons Attribution-Share Alike 3.0 Unported License
* Please visit http://www.joomlashine.com for more information
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted index access' );
define( 'YOURBASEPATH', dirname(__FILE__) );
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Free Joomla! template by JoomlaShine.com - JSN Epic Free 2.0 for Joomla! 1.5.x -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language ?>" dir="<?php echo $this->direction; ?>">
<head>
<?php
                $tplurl = JURI::base().'templates/'.$this->template;
$curlang = $document->language;
?>
<jdoc:include type="head" />
<?php
require( YOURBASEPATH.DS."php/jsn_utils.php");
/****************************************************************/
/* TEMPLATE PARAMETERS */

/* Overal template width specified in pixels (for fixed width) or percentage (for fluid width). */
$template_width = $this->params->get("templateWidth", "960px");

/* Path to logo image starting from the Joomla! root folder (! without preceding slash !). */
       $logo_path = $this->params->get("logoPath", "templates/jsn_epic_free/images/logo_ua.jpg");

/* Logo width specified in pixels. */
$logo_width = $this->params->get("logoWidth", "960px");

/* Logo height specified in pixels. */
$logo_height = $this->params->get("logoHeight", "160px");

/* URL where logo image should link to (! without preceding slash !). */
$logo_link = $this->params->get("logoLink", "");

/* Definition whether to enable PNG fix feature for IE6 or not.
   This parameter should be turned off only when there are incompatibility issues. */
$enable_pngfix = ($this->params->get("enablePNGfix", 1) == 1)?"yes":"no"; // yes | no


/****************************************************************/

/* Private use only */
$template_path = $this->baseurl."/templates/".$this->template;
$has_right = $this->countModules('right');
$has_left = $this->countModules('left');

$logo_image = $this->baseurl."/".$logo_path;
$logo_text = $mainframe->getCfg('sitename');

// Parameter filter
$template_width = intval($template_width);
$template_width .= ($template_width < 100)?"%":"px";
$logo_width = intval($logo_width)."px";
$logo_height = intval($logo_height)."px";
$logo_link = ($logo_link != "")?$this->baseurl."/".$logo_link:"";
?>
<link rel="shortcut icon" href="<?php echo $this->baseurl; ?>/images/favicon.ico" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" />
<link href="<?php echo $template_path; ?>/css/template.css" rel="stylesheet" type="text/css" media="screen" />
<?php

// Inline CSS styles for template layout
echo '<style type="text/css">';

// Setup template width parameter
echo '
#jsn-page {
width: '.$template_width.';
}
';

[color=red][b]Вот сюда я пытался вставить фрагмент кода, выдало ошибку.[/b][/color]
// Adjustment of header area according to the logo height parameter
echo '
#jsn-header {
height: '.$logo_height.';
}
';

// Setup width of content area
$tw = 100;
if ($has_left) {
$tw -= 23;
echo '
#jsn-content_inner1 {
background: transparent url('.$template_path.'/images/leftside-bg-full.png) repeat-y 23% top;
padding: 0;
}
#jsn-maincontent_inner {
padding-left: 0;
}
';
}

if ($has_right) {
$tw -= 23;
echo '
#jsn-content_inner2 {
background: transparent url('.$template_path.'/images/rightside-bg-full.png) repeat-y 77% top;
padding: 0;
}
#jsn-maincontent_inner {
padding-right: 0;
}
';
}
if(intval($template_width) < 100) {
$tws = ($tw - 0.1).'%';
}else{
$tws = floor($tw*0.01*intval($template_width)).'px';
}
echo '
#jsn-leftsidecontent {
float: left;
width: 23%;
}
#jsn-maincontent {
float: left;
width: '.$tws.';
}
#jsn-rightsidecontent {
float: right;
width: 23%;
}
';

echo '</style>';

// Setup core javascript library
echo '<script type="text/javascript" src="'.$template_path.'/js/jsn_script.js"></script>';
?>

<!--[if lte IE 6]>
<link href="<?php echo $template_path; ?>/css/jsn_fixie6.css" rel="stylesheet" type="text/css" />
<?php if($enable_pngfix == "yes") {?>
<script type="text/javascript">
var blankImg = '<?php echo $this->baseurl; ?>/images/blank.png';
</script>
<style type="text/css">
img {  behavior: url(<?php echo $template_path;?>/js/iepngfix.htc); }
</style>
<?php } ?>
<![endif]-->
<!--[if lte IE 7]>
<script type="text/javascript" src="<?php echo $template_path; ?>/js/suckerfish.js"></script>
<![endif]-->
<!--[if IE 7]>
<link href="<?php echo $template_path; ?>/css/jsn_fixie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
</head>
<body id="jsn-master">
<div id="jsn-page">
<div id="jsn-header">
<div id="jsn-logo"><?php if ($logo_link != "") echo '<a href="'.$logo_link.'" title="'.$logo_text.'">'; ?><img src="<?php echo $logo_image;?>" width="<?php echo intval($logo_width); ?>" height="<?php echo intval($logo_height); ?>" alt="<?php echo $logo_text; ?>" /><?php if ($logo_link != "") echo '</a>'; ?></div>
<?php if ($this->countModules( 'top' ) > 0) { ?>
<div id="jsn-ptop"><jdoc:include type="modules" name="top" style="xhtml" /></div>
<?php } ?>
</div>
<div id="jsn-body">
<?php if (jsnCountPositions($this, array('toolbar', 'inset'))) { ?>
<div id="jsn-mainmenu">
<?php if ($this->countModules( 'toolbar' ) > 0) { ?>
<div id="jsn-ptoolbar"><jdoc:include type="modules" name="toolbar" style="xhtml" /></div>
<?php } ?>
<?php if ($this->countModules( 'inset' ) > 0) { ?>
<div id="jsn-pinset"><jdoc:include type="modules" name="inset" style="xhtml" /></div>
<?php } ?>
</div>
<?php } ?>
<?php if ($this->countModules( 'header' ) > 0) { ?>
<div id="jsn-promo">
<div id="jsn-pheader" class="jsn-column"><jdoc:include type="modules" name="header" style="xhtml" /></div>
</div>
<?php } ?>
<div id="jsn-content"><div id="jsn-content_inner1"><div id="jsn-content_inner2">
<?php if ($this->countModules( 'left' ) > 0) { ?>
<div id="jsn-leftsidecontent" class="jsn-column">
<div id="jsn-pleft"><jdoc:include type="modules" name="left" style="rounded" /></div>
</div>
<?php } ?>
<div id="jsn-maincontent" class="jsn-column"><div id="jsn-maincontent_inner">

<?php
$positionCount = jsnCountPositions($this, array('user1', 'user2'));
if($positionCount){
$grid_suffix = "_grid".$positionCount;
?>
<div id="jsn-usermodules1"><div id="jsn-usermodules1_inner<?php echo $grid_suffix; ?>">
<?php if ($this->countModules( 'user1' ) > 0) { ?>
<div id="jsn-puser1<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-puser1"><jdoc:include type="modules" name="user1" style="xhtml" /></div></div>
<?php } ?>
<?php if ($this->countModules( 'user2' ) > 0) { ?>
<div id="jsn-puser2<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-puser2"><jdoc:include type="modules" name="user2" style="xhtml" /></div></div>
<?php } ?>
<div class="clearbreak"></div>
</div></div>
<?php } ?>
<div id="jsn-mainbody">
<jdoc:include type="message" />
<jdoc:include type="component" />
</div>
<?php
$positionCount = jsnCountPositions($this, array('user3', 'user4'));
if($positionCount){
$grid_suffix = "_grid".$positionCount;
?>
<div id="jsn-usermodules2"><div id="jsn-usermodules2_inner<?php echo $grid_suffix; ?>">
<?php if ($this->countModules( 'user3' ) > 0) { ?>
<div id="jsn-puser3<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-puser3"><jdoc:include type="modules" name="user3" style="xhtml" /></div></div>
<?php } ?>
<?php if ($this->countModules( 'user4' ) > 0) { ?>
<div id="jsn-puser4<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-puser4"><jdoc:include type="modules" name="user4" style="xhtml" /></div></div>
<?php } ?>
<div class="clearbreak"></div>
</div></div>
<?php } ?>
<?php if ($this->countModules( 'banner' ) > 0) { ?>
<div id="jsn-banner"><jdoc:include type="modules" name="banner" style="xhtml" /></div>
<?php } ?>
</div></div>
<?php if ($this->countModules( 'right' ) > 0) { ?>
<div id="jsn-rightsidecontent" class="jsn-column">
<div id="jsn-pright"><jdoc:include type="modules" name="right" style="rounded" /></div>
</div>
<?php } ?>
<div class="clearbreak"></div>
</div></div></div>
<?php
$positionCount = jsnCountPositions($this, array('user5', 'user6', 'user7'));
if($positionCount){
$grid_suffix = "_grid".$positionCount;
?>
<div id="jsn-usermodules3"><div id="jsn-usermodules3_inner<?php echo $grid_suffix; ?>">
<?php if ($this->countModules( 'user5' ) > 0) { ?>
<div id="jsn-puser5<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-puser5"><jdoc:include type="modules" name="user5" style="xhtml" /></div></div>
<?php } ?>
<?php if ($this->countModules( 'user6' ) > 0) { ?>
<div id="jsn-puser6<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-puser6"><jdoc:include type="modules" name="user6" style="xhtml" /></div></div>
<?php } ?>
<?php if ($this->countModules( 'user7' ) > 0) { ?>
<div id="jsn-puser7<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-puser7"><jdoc:include type="modules" name="user7" style="xhtml" /></div></div>
<?php } ?>
<div class="clearbreak"></div>
</div></div>
<?php } ?>
</div>
<?php
$positionCount = jsnCountPositions($this, array('footer', 'bottom'));
if($positionCount){
$grid_suffix = "_grid".$positionCount;
?>
<div id="jsn-footer">
<?php if ($this->countModules( 'footer' ) > 0) { ?>
<div id="jsn-pfooter<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-pfooter"><jdoc:include type="modules" name="footer" style="xhtml" /></div></div>
<?php } ?>
<?php if ($this->countModules( 'bottom' ) > 0) { ?>
<div id="jsn-pbottom<?php echo $grid_suffix; ?>" class="jsn-column"><div id="jsn-pbottom"><jdoc:include type="modules" name="bottom" style="xhtml" /></div></div>
<?php } ?>
<div class="clearbreak"></div>
</div>
<?php } ?>
</div>
<?php
?>
<jdoc:include type="modules" name="debug" style="xhtml" />
<?php require( YOURBASEPATH.DS."php/jsn_debug.php"); ?>
</body>
</html>
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Вот теперь более менее понятно. Но давай отложим до завтра вернее сегодня. Долгий разговор в аське будет
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Пробуем. Найди
Код: php
$logo_image = $this->baseurl."/".$logo_path;
$logo_text = $mainframe->getCfg('sitename');
Примерно 54 строка
И замени на
Код: php
    //$logo_image = $this->baseurl."/".$logo_path;
    switch ($this->getLanguage()){
  case 'ru-ru':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_ru.jpg";
  $logo_text = "Русский Логотип";  
  break;

  case 'en-gb':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_en.jpg";
  $logo_text = "English Logo";
  
  break;
  case 'uk-ua':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_ua.jpg";
  $logo_text = "Український Логотип";  
  break;

  case 'de-de':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_de.jpg";
  $logo_text = "Deutsch Logo";  
  break;

  case 'it-it':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_it.jpg";
  $logo_text = "Italian Logo";  
  break;

  default :
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_ua.jpg";
  $logo_text = "Український Логотип";  
  break;
  }  
    //$logo_text = $mainframe->getCfg('sitename');
« Последнее редактирование: 16.01.2010, 14:33:40 от Lex »
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Воткнул, ситуация та же: Parse error: syntax error, unexpected '>' in /home/h20082/data/www/gulych.com.ua/templates/jsn_epic_free/index.php on line 56

Код
/* Private use only */
$template_path = $this->baseurl."/templates/".$this->template;
$has_right = $this->countModules('right');
$has_left = $this->countModules('left');

//$logo_image = $this->baseurl."/".$logo_path;
    switch ($this->getLanguage()){
  case 'ru-RU':>
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_ru.jpg";
  $logo_text = "Русский Логотип";   
  break;
 
  case 'en-GB':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_en.jpg";
  $logo_text = "English Logo";
 
  break;
  case 'uk-UA':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_ua.jpg";
  $logo_text = "Український Логотип"; 
  break;
 
  case 'de-DE':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_de.jpg";
  $logo_text = "Deutsch Logo";   
  break;
 
  case 'it-IT':
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_it.jpg";
  $logo_text = "Italian Logo"; 
  break;
 
  default :
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_ua.jpg";
  $logo_text = "Український Логотип"; 
  break;
  }   
    //$logo_text = $mainframe->getCfg('sitename');

// Parameter filter
$template_width = intval($template_width);
$template_width .= ($template_width < 100)?"%":"px";
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Ага
case 'ru-ru':>
так
case 'ru-ru':
моя вина
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Lex, ошибка пропала, страничка грузится, но все равно шапку не меняет, может быть из-за двух остальных файлов?

В файле params.ini:

Код
logoPath=templates/jsn_epic_free/images/logo_ua.jpg
logoWidth=960px
logoHeight=160px
logoLink=index.php


В файле templateDetails.xml:
Код
<param name="logoPath" size="50" type="text" default="templates/jsn_epic_pro/images/logo_ua.jpg" label="Logo Path" description="Path to logo image starting from the Joomla! root folder (! without preceding slash !)"/>
<param name="logoWidth" type="text" default="960px" label="Logo Wdith (px)" description="Logo width specified in pixels"/>
<param name="logoHeight" type="text" default="160px" label="Logo Height (px)" description="Logo height specified in pixels"/>

Я с самого начала когда переделывал хедер, пока во всех трех местах не заменил информацию оно ее не поменяло. И когда прощелкиваю шапку по языкам всегда одна и та же надпись Украинский Логотип, то есть видно, что шапку даже не пытается менять.
« Последнее редактирование: 16.01.2010, 15:10:50 от Lex_Amorph »
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Не должно. Похоже не выполняется выбор. Где дефолт замени картинку
default :
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_ru.jpg";
Блин трудно вслепую писать
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Не должно. Похоже не выполняется выбор. Где дефолт замени картинку
default :
  $logo_image = JURI::base()."templates/jsn_epic_free/images/logo_ru.jpg";
Блин трудно вслепую писать

Изменил, теперь на всех языках стоит русская картинка и пишется Русский Логотип. 0_0 Но другие все равно не выбирает.
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Ага. Тогда где нибудь в шаблоне на видном месте на светлом фоне вставь
Код: php
<?php
echo $this->getLanguage();
?>
и попереключай языки будет ли надпись меняться
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Нашел. Не посмотрел сразу
не 'ru-RU', а 'ru-ru'. И так со всеми языками.
Что думаю за чертовщина

Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
ПОЛУЧИЛОСЬ! :D
Lex, ОГРОМНОЕ спасибо!  *DRINK* и +1. Переключает как тут и было! ;D

Еще одно уточнение, в файл templateDetails.xml добавил в список файлов все 5 хедеров.

Код
<filename>images/logo_ua.jpg</filename><filename>images/logo_ru.jpg</filename><filename>images/logo_de.jpg</filename><filename>images/logo_en.jpg</filename><filename>images/logo_it.jpg</filename>

Видимо, этого ему тоже не хватало для счастья.
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Не он в данном случае не влияет. Это только для установки шаблона. Чтобы картинки загрузить при установке.
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Может быть прицепить тему где-нибудь, вдруг кому-нибудь еще пригодится такое решение?
*

beliyadm

  • Легенда
  • 9758
  • 1664 / 66
  • Севастополь, Россия
Все истины, которые я хочу вам изложить, — бесстыдная ложь. Сделать всё хорошо
TLG: @Beliyadm
*

Lex_Amorph

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
beliyadm, так там 2006-2008 года топики, где еще для Joomla 1.0 реализовано почти все, совсем немножко информации для 1.5, да и напрямую они вопроса именно замены хедера в мультиязычном сайте не касаются, я проглядел все три темы, с помощью только их я бы этот вопрос точно не решил, например.  ^-^
*

Lex

  • Завсегдатай
  • 1615
  • 274 / 1
Потому что задача специфическая, для конкретного шаблона. Для других шаблонов, как готовый рецепт, применять нельзя.
Жизнь заставила учиться.
В личке на вопросы не отвечаю.
*

beliyadm

  • Легенда
  • 9758
  • 1664 / 66
  • Севастополь, Россия
В тех темах что самое главное - описана работа с $this->getLanguage(), отлов языка, а уж что потом с этим делать - дело каждого.
Описывать все возможные ситуации в шаблонах (смену картинки, CSS, фона, текста, названия, модулей и так далее) - дело неблагодарное.
Все истины, которые я хочу вам изложить, — бесстыдная ложь. Сделать всё хорошо
TLG: @Beliyadm
*

aliaf

  • Новичок
  • 8
  • 0 / 0
Добрый день.
У меня случай, может быть, проще.
Есть
<div class="logo">
 <h1 id="name-text" class="logo-name"><a href="<?php echo $baseUrl; ?>/">Павел Зальцман</a></h1>
 <div id="slogan-text" class="logo-text">1912-1985</div>
</div>
Хотелось бы, чтобы текст на русском языке <?php echo $baseUrl; ?>/">Павел Зальцман</a>
при смене языка сайта менялся на английский.
Помогите, кто может!
« Последнее редактирование: 10.03.2010, 16:09:29 от aliaf »
*

kill_kenny

  • Новичок
  • 1
  • 0 / 0
Добрый день.
Все помогло для 2 языков :
<center>
<?php
      if ($curlang == 'ru-ru') {
       echo '<img src="'.$tplurl.'/images/header_ru.png"/>';}
       else { echo '<img src="'.$tplurl.'/images/header_ua.png"  />'; }
        ?>
     
</center>

Но проблема, шапки пливут при маштабировании и не центрируются - "держатся за левий край" , о одним проблем небыло.
Помогите пожалуйста!
*

lawrik2005

  • Осваиваюсь на форуме
  • 13
  • 0 / 0
Замена шапки для мультиязычного сайта с нестандартным расположением logo
вы можете помочь мне с подобным вопросом если я вам открою доступ к сайту? я обязательно отблагодарю вас.....
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

как изменять title сайта при переключении языков (JoomFish)

Автор archibald07

Ответов: 4
Просмотров: 5210
Последний ответ 26.08.2013, 10:36:01
от Ejenie
[решено] Как сделать, чтобы у сайта каждая языковая версия имела свой домен?

Автор Sulpher

Ответов: 9
Просмотров: 10802
Последний ответ 26.09.2012, 17:08:22
от sergoguga
как скрыт модуль в анг. версии сайта и меню одну ссылку

Автор mxxx

Ответов: 1
Просмотров: 2511
Последний ответ 06.07.2012, 11:38:15
от mxxx
[решено] JoomFish, как отключить автоопределение языка посетителя?

Автор dsolve

Ответов: 3
Просмотров: 6469
Последний ответ 18.07.2011, 07:25:21
от Лена)
Два языка в текстовом логотипе сайта

Автор aliaf

Ответов: 6
Просмотров: 3838
Последний ответ 29.04.2010, 23:17:35
от Pinot