-
AuthorPosts
-
August 1, 2007 at 10:28 pm #121774
I got some problem with using the spotlight modules for a multilingual site and the Rochea template.
What I have done is the following…:
I included this among the global variables in the template…
[PHP]$mosConfig_lang[/PHP]
And then changed the spotlight code as follows…
[PHP]
<?php
$spotlight = array (‘user1_en’,’user2_en’,’user5_en’,’user1_se’,’user2_se’,’user5_se’);
$topspl = calSpotlight ($spotlight);
if( $topspl ) {
?>
<!– BEGIN: TOP SPOTLIGHT –>
<div id=”ja-topslwrap”>
<div id=”ja-topsl” class=”clearfix”><?php if ($mosConfig_lang== english ){ // Only load user1_en if language is english.
if( mosCountModules(‘user1_en’) ) {?>
<div class=”ja-box<?php echo $topspl[‘modules’][‘user1_en’]; ?>” style=”width: <?php echo $topspl[‘width’]; ?>;”>
<?php mosLoadModules(‘user1_en’, -2); ?>
</div>
<?php }} ?><?php if ($mosConfig_lang== english ){ // Only load user2_en if language is english.
if( mosCountModules(‘user2_en’) ) {?>
<div class=”ja-box<?php echo $topspl[‘modules’][‘user2_en’]; ?>” style=”width: <?php echo $topspl[‘width’]; ?>;”>
<?php mosLoadModules(‘user2_en’, -2); ?>
</div>
<?php }} ?><?php if ($mosConfig_lang== english ){ // Only load user5_en if language is english.
if( mosCountModules(‘user5_en’) ) {?>
<div class=”ja-box<?php echo $topspl[‘modules’][‘user5_en’]; ?>” style=”width: <?php echo $topspl[‘width’]; ?>;”>
<?php mosLoadModules(‘user5_en’, -2); ?>
</div>
<?php }} ?><?php if ($mosConfig_lang== swedish ){ // Only load user1_se if language is swedish.
if( mosCountModules(‘user1_se’) ) {?>
<div class=”ja-box<?php echo $topspl[‘modules’][‘user1_se’]; ?>” style=”width: <?php echo $topspl[‘width’]; ?>;”>
<?php mosLoadModules(‘user1_se’, -2); ?>
</div>
<?php }} ?><?php if ($mosConfig_lang== swedish ){ // Only load user2_se if language is swedish.
if( mosCountModules(‘user2_se’) ) {?>
<div class=”ja-box<?php echo $topspl[‘modules’][‘user2_se’]; ?>” style=”width: <?php echo $topspl[‘width’]; ?>;”>
<?php mosLoadModules(‘user2_se’, -2); ?>
</div>
<?php }} ?><?php if ($mosConfig_lang== swedish ){ // Only load user5_se if language is swedish.
if( mosCountModules(‘user5_se’) ) {?>
<div class=”ja-box<?php echo $topspl[‘modules’][‘user5_se’]; ?>” style=”width: <?php echo $topspl[‘width’]; ?>;”>
<?php mosLoadModules(‘user5_se’, -2); ?>
</div>
<?php }} ?>
</div>
<div class=”sep”></div>
</div>
<!– END: TOP SPOTLIGHT –>[/PHP]
I then put up some new modulepossitions in the backend and made some copies of the spotlight modules to use one for an English translation and one set for a Swedish translation.
The English ones show up as they should on my english frontend as they should. When activating the ones that should be used if the language is Swedish messes things up a bit. First they don’t show up at my Swedish frontpage and I will also get an empty space big as the spotlights on my english frontpage for each spotlightmodule I assign to my Swedish frontpage.
Anyone got any usefull suggestiosn on how to solve this so one can use different spotlights for different languages until there is a new version out that can be translated with Joom!fish?
Any tips and suggestions would be appreaciated and excuse my bad english.
Solved by putting the paryt of the code in a separate file named spotloader_se.php for swedish and spotloader_en.php for english etc and then I did change the code in index.php as follows…
[PHP]
<!– BEGIN: TOP SPOTLIGHT –>
<script type=”text/javascript”> jaSLWI.expandH = 120;</script>
<?php switch ($mosConfig_lang){
case”english”:
include_once( $ja_template_absolute_path.’/spotloader_en.php’ );
break;case”swedish”:
include_once( $ja_template_absolute_path.’/spotloader_se.php’ );
break;default:
include_once( $ja_template_absolute_path.’/spotloader_en.php’ );
break;
}
?><!– END: TOP SPOTLIGHT –>
[/PHP]Which lets me load a different php file depending on which language is used. I then have changed all the user1, user2, user5 to user1_se, user1_en etc and created thoose possitions from the backend. This seems to work even though it probably could be done in a better way. Still. I am pretty satisfied and for a guy who haven’t wrote a single PHP line until 2 days ago I think I managed pretty well. The problem I had was that the spotlights loaded empty spaces for each copy I made of them in the backend and assigned to the different languages I use on the site. That didn’t look so well and with just one language added the spotlights was only shwned with half wide on the frontpage. I hope there will come an improved and updated version of this module so one can make translations directly with Joom!Fish instead of having to tweak the template and module code.
August 2, 2007 at 8:04 pm #226158Anyone who have any clue of how to solve this??
August 4, 2007 at 2:43 pm #226342I managed to solve it but got another problem now regarding the spotlights.
In the mod_ja_slwi.php file I have the following code.
[PHP]
<script type=”text/javascript”>
textbg = document.getElementById(“ja-slwi-textbg’.($ja_slwi_id).'”);
textbg.style.opacity = ‘.($trans/100).’;
textbg.style.filter = ‘alpha(opacity=’.$trans.’)’;
</script>[/PHP]
On an english site it gives the following output…
<script type="text/javascript">
textbg = document.getElementById("ja-slwi-textbg1");
textbg.style.opacity = 0.8;
textbg.style.filter = 'alpha(opacity=80)';
</script>
And when using Scandinavian languages it gives the following…:
<script type="text/javascript">
textbg = document.getElementById("ja-slwi-textbg1");
textbg.style.opacity = 0,8;
textbg.style.filter = 'alpha(opacity=80)';
</script>
The result is no textbg at all if choosing any Scandinavian based languages.
How can I prevent the translation of the dot to a comma? I think that this might be considered as a bug since I assume that the spotlights was intended to work for all possible languages.
I have looked in the Swedish languagefile for Joomla since that’s the only file defining the languages that can cause this problem but I can’t find anything… Any suggestions would be welcome.
August 4, 2007 at 3:18 pm #226343Think I managed to find a solution for this aswell.. In the file mod_ja_slwi.php I changed the code as follows which seems to be working…
[PHP]
<script type=”text/javascript”>
textbg = document.getElementById(“ja-slwi-textbg’.($ja_slwi_id).'”);
textbg.style.opacity = “0.’.($trans).'”;
textbg.style.filter = ‘alpha(opacity=’.$trans.’)’;
</script>
[/PHP] -
AuthorPosts
This topic contains 4 replies, has 1 voice, and was last updated by csib 17 years, 6 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum