21
draj
Re: Different Theme for Each Language, Script
  • 2006/12/13 15:56

  • draj

  • Quite a regular

  • Posts: 271

  • Since: 2005/6/23


Hi!

I tried both the solutions you suggested. Also deleted the cache and template_c but no change. It does not work.

If I can get the templates change working, then one may try to have the blocks with {if}..{else} tags make them dissappear or change.

However with 2.2.5RC2, it does not work.

22
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/12/13 16:13

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


you can test the following method,

open your theme.html file, and edit one of the images this way for eg:

<img src="http://yoursite.com/[en]imageEN.jpg[/en][ar]imageDE.jpg[/ar]"> </img>

this usually works , i have tried it on a couple of different sites, and if it works, then you can also insert lang tags to specify which block template files to be used. or rather which CSS to use (u can make two CSS files, style.css and styleAR.css to change the blocks orientation..etc..), i am not so sure about the content of the blocks, but there must be a way, but i just dont know it. sorry.

23
draj
Re: Different Theme for Each Language, Script
  • 2006/12/13 17:59

  • draj

  • Quite a regular

  • Posts: 271

  • Since: 2005/6/23


Hallo BCdudes!

As you suggested, the tags [en] works perfect. However the blocks show up in different languages where they are there.

Now phppp can help us here, if he sees and has the time and interest!

I have looked into all the areas and found the following:

1.
One needs to add one field in xoops_block_instance

When creating the field, give the default to the existing language, for e.g. en. Hence all the existing blocks will be assigned to en blocks.

2.
Add line 237 in kernel/block.php
> ??
'lang' => $block_arr[$i]->getVar('lang'),

3.
include/common.php

define ("XOOPS_BLOCK_LANGUAGE", 2);

4.
Do what phppp says to do further!

Here the idea is to insert lang variable in the table field and get it through the SQL query, work for the render of that block.

24
irmtfan
Re: Different Theme for Each Language, Script
  • 2006/12/13 19:57

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:
A 2.2.4 multilanguage site...arabic/english yet NO hack, NO two themes, NO two style.css just the brilliant xlanguage tags that shifts the header from right to left when arabic and from left to right when english


what's your method exactly?
dont you think adding a row in the footer.php to read style from language is better?

@ deepy:
as i said before for a RTL theme you dot need to change themes between language.
just use the method i describe in the last posts.
for 2.2+ you can use this code:

add these rows in footer.php
if ( file_exists(XOOPS_ROOT_PATH."/language/".$GLOBALS['xoopsConfig']['language']."/css/"._LANGCODE.".css") ) {
            
$langcss XOOPS_URL."/language/".$GLOBALS['xoopsConfig']['language']."/css/"._LANGCODE.".css";
            
$langcss '<link rel="stylesheet" type="text/css" media="screen" href="'.$langcss.'" />';
            if (
$xoopsTpl->get_template_vars('xoops_module_header')) {
                
$xoopsTpl->assign('xoops_module_header'$xoopsTpl->get_template_vars('xoops_module_header')."n$langcss");
            } else {
                
$xoopsTpl->assign('xoops_module_header'$langcss);
            }
        }


just before this row:
$GLOBALS['xTheme']->display($template);

then upload ar.css ( ar for arabic?) in the proper directory

25
draj
Re: Different Theme for Each Language, Script
  • 2006/12/13 21:01

  • draj

  • Quite a regular

  • Posts: 271

  • Since: 2005/6/23


Hallo irmtfan!

Thanks for your suggestion.

There is a misunderstanding.

I MUST change the theme because for different languages there are different graphics written in different languages. This can however be changed with the [] tags of the xLanguages but I need different layouts for different languages.

I do not use all the modules in both the languages and want to have a totally different combination.

Further, the above suggestion DOES trigger on addressing shootong different blocks with different languages.

I hope you understand.

Thanks.

26
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/12/13 23:01

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


What you can do (Provided that you have the same number of modules in both ur languages) is create mock modules with:
index.php
logo.gif
xoops_version.php

and then in index.php, u can put an if clause to check the language, and if lang is "en", it would take you to module " Games", and if language is "fr", it would take you to module "Romance", for e.g.: (my php is crap, so this code has a 99% chance of NOT working, but you get the idea)

if ($xoopsConfig['language'] == 'en') { 

<
SCRIPT language="JavaScript">
<!--
window.location="http://www.site.com/modules/[color=CC0000]Games/[/color]";
//-->
</SCRIPT>

  } 

if (
$xoopsConfig['language'] == 'fr') { 

<
SCRIPT language="JavaScript">
<!--
window.location="http://www.site.com/modules/[color=CC0000]Romance/[/color]";
//-->
</SCRIPT>  }


Something like that, I am not the expert.

So this way, you can change the modules for the different languages, but as i said, you will have to have the same number of modules for this method to work...


my methods are usually simple and crap and inefficient, but they do the job , for me at least

27
draj
Re: Different Theme for Each Language, Script
  • 2006/12/14 6:25

  • draj

  • Quite a regular

  • Posts: 271

  • Since: 2005/6/23


Hi BCdudes!

Thanks for your ideas. I will definately try to implement once I get the block problems solved.

Let me make it clear once again:

I AM LOOKING FOR A SOLUTION FOR BLOCKS that disappear selecting a language!

I have two left blocks from content modules.

One has english content and the second has german content. Havng the same title with [en][de] tags DOES NOT WORK!

We want to show the german block in german ONLY. Here the english block should disappear.

The problem is, that the blocks do not have any extra parameter from the core coming out. Hence the only solution I can imagine is to have a field in the database table and capture it, bringinginto the templates.

I would also be pleased to live with a simple, dirty quick solution, instead of waiting for light years, a speed with which XOOPS is developing.

Login

Who's Online

142 user(s) are online (96 user(s) are browsing Support Forums)


Members: 0


Guests: 142


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits