2 Languages and two different templates! Is that possible? 2 Languages and two different templates! Is that possible?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

2 Languages and two different templates! Is that possible?

Started by SamBrown, December 20, 2005, 05:16:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SamBrown

Hi

I have a HTML-Homepage with Coppermine-Gallery included. I have english and german Sites under this Homepage. The index.html file of the first page is in german. At the bottom there is a language switching link who start's index_e.html for the english start page. In every site i have included a Javascript menue (menu.js and menu_e.js) depending on the choosen language.

The button in the german menue for the gallery ist linked to http://...mysite.../cgi-bin/cpg133/index.php?lang=german
The button in the english menue for the gallery ist linked to http://...mysite.../cgi-bin/cpg133/index.php?lang=english

I had modified the template.html and removed the {MAIN_MENU]. Instead i have included the JavaScript-Menu into the template which calls a german menue. Now i have the Problem if a user selects the english language the menue is always german. I think a second template.html and a second index.php (index_e.php which calls the second template) is the right way to a solution.

Am i right or have you any other suggestion ?

Thanxs for a quick reply...

Sam

SamBrown

I found a part of a solution http://forum.coppermine-gallery.net/index.php?topic=3138.0 in this topic.

My default gallery-language is german. So i think that i need only to handle the special case if language is english. I have copied my original theme "sassa" to a new theme "sassa_e" for the english language. then i have edited the template.html of "sassa_e" theme and included the english java-menuscript. Then i modified init.inc.php line this ...

Before:
=====
if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
$THEME_DIR = "themes/{$CONFIG['theme']}/";


After:
====
if ($_GET["lang"] == 'english' ) { $theme='sassa_e';
        require "themes/sassa/theme.php";
        $THEME_DIR = "themes/sassa_e/";
} else {
if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
$THEME_DIR = "themes/{$CONFIG['theme']}/";
}


Now it works, but only on the first site... If i click on a Breadcrumb link or a thumbnail-Picture in the english theme, then the theme switch back to de german theme. I think i have to modify thumbnails.php and displayimage.php. But i cannot find out where and how... Have you any suggestion for me please ?

Thanxs a lot


Sam

SamBrown

First i think i have the problem solved very easy....  ;D ;D

I have successfully updated to 1.4.2. Then i found a hint to link directly to a theme... An here it is...

The button in the german menue for the gallery ist linked to http://...mysite.../cgi-bin/cpg133/index.php?lang=german&theme=sassa
The button in the english menue for the gallery ist linked to http://...mysite.../cgi-bin/cpg133/index.php?lang=english&theme=sassa_e


(sassa is my german theme, sassa_e is my english theme)

This works fine with the original init.inc.php without modifications...

Thanxs anyway