4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 24, 2014, 05:24:49 PM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [MOD] Language select
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: «« « 1 2 3 4 [5] 6 7 8 9 ... 16 » »» Print
Current Topic Rating: *****
Author Topic: [MOD] Language select  (Read 173834 times)
Xyu BAM
Full Member
***
Offline Offline

Posts: 145

Thank You
-Given: 0
-Receive: 2


View Profile
« Reply #60 on: September 11, 2005, 08:02:07 AM »

I've experienced this issue too, its a "bug" in vano's code...
you will need replace
1
if ($config['language_dir'] == $l) $config['template_dir'] .= "_".$l;
with:
1
if ($config['language_dir_default'] != $config['language_dir']) $config['template_dir'] .= "_".$l;
Logged
martrix
Hero Member
*****
Offline Offline

Posts: 755

Thank You
-Given: 0
-Receive: 6


View Profile WWW
« Reply #61 on: September 11, 2005, 11:42:51 AM »

Hi X yu, what problem did the bug cause?
Logged

MAяTRIX

Xyu BAM
Full Member
***
Offline Offline

Posts: 145

Thank You
-Given: 0
-Receive: 2


View Profile
« Reply #62 on: September 11, 2005, 12:36:18 PM »

The condition V@no used  would return true when l=<lang> was append to the url so, if you append l=<default lang> it would also require additional template for default lang...
Logged
Matthias70
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #63 on: September 11, 2005, 12:53:41 PM »

The condition V@no used  would return true when l=<lang> was append to the url so, if you append l=<default lang> it would also require additional template for default lang...

That's my problem but I have'nt got this code
Replace
1
if ($config['language_dir'] == $l) $config['template_dir'] .= "_".$l;with:
with
1
if ($config['language_dir_default'] != $config['language_dir']) $config['template_dir'] .= "_".$l;

That's the code from V@nos extension
http://www.4homepages.de/forum/index.php?topic=4743.msg32679#msg32679

I don't use this extension code, but I've the problem you described.
Any suggestions how I can change the original language select code?

Matthias


Logged

Xyu BAM
Full Member
***
Offline Offline

Posts: 145

Thank You
-Given: 0
-Receive: 2


View Profile
« Reply #64 on: September 11, 2005, 07:49:52 PM »

I have no idea what are u talking about, but this is what you wrote before:
Logged
Matthias70
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #65 on: September 11, 2005, 08:15:50 PM »

I have no idea what are u talking about, but this is what you wrote before:

Sorry it was my fault. I was searching for your code in page_header and functiosn.php but not in global.php  Rolling Eyes

Your code is perfect. I just had some problems with my template names so I had to change your code to
1
if ($config['language_dir_default'] != $config['language_dir']) $config['template_dir'] .= "".$l;

The problem was just an _ . So 4images was looking for a default_  template.
When I renamed my template to default_ 4images was looking for default...

What do you think? Is this O.K. to take out the _ from yopur code, or could it cause some problems.
It seems to me everything is O.K.

Thank you
Matthias
Logged

IWS_steffen
Full Member
***
Offline Offline

Posts: 128

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #66 on: September 11, 2005, 11:10:33 PM »


Nun noch eine Frage.

Ich möchte auch einige Beschreibungen der Bilder und Kategoerien sowohl in deutsch als auch in englisch anzeigen lassen.
Muss ich die Texte in der main.php (english und deutsch) abspeichern?
Was muss ich auf der Website einbauen, um dies anzuzeigen?
Ein kleines Beispiel wäre sehr hilfreich.

Danke

Grüsse aus Hamburg

Steffen

Hallo

Hat denn wirklich keiner einen Tipp für mich:-)

Ohne dass ich auch alle relevanten Daten (Kategoriename, Beschreibung, Schlüsselbegriffe)  sowohl in deutsch als auch in englisch abspeichern kann ist dieser MOD doch nur halb so gut....

Gibt es da nicht eine Lösung?

Danke

Steffen
Logged

Matthias70
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #67 on: September 11, 2005, 11:17:39 PM »

Hallo Steffen,
ich habe zwei Language Ordner.
Einen für Deutsch und einen für Englisch.

Dann habe ich dieses Mod hier installiert und jeder User kann nun zwischen Englisch und Deutsch wählen.

Anschließend habe ich noch das Mulitlanguage Mod installiert und nun ist es auch möglich die Kategorien und Bildernamen in Deutsch und Englisch anzuzeigen. Allerdings nicht gleichzeitig, sondern je nachdem welche Sprache der User wählt.

Ich muss aber zugeben, dass der Einbau des Multilanguage Mod sehr abenteuerlich war. Hab es immer noch nicht vollkommend zufriedenstellend geschafft.

viele Grüße
Matthias
Logged

Xyu BAM
Full Member
***
Offline Offline

Posts: 145

Thank You
-Given: 0
-Receive: 2


View Profile
« Reply #68 on: September 12, 2005, 08:16:18 AM »

What do you think? Is this O.K. to take out the _ from yopur code, or could it cause some problems.
It seems to me everything is O.K.

as long as your template folder does not contein " _ " in it, (i.e. defaultdeutsch) its fine.
Logged
Matthias70
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #69 on: September 12, 2005, 11:43:16 AM »

as long as your template folder does not contein " _ " in it, (i.e. defaultdeutsch) its fine.

Thank you, for your help
Matthias
Logged

IWS_steffen
Full Member
***
Offline Offline

Posts: 128

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #70 on: September 12, 2005, 09:55:04 PM »

Hallo Matthias.

Danke für den Tipp. Smile


Anschließend habe ich noch das Mulitlanguage Mod installiert und nun ist es auch möglich die Kategorien und Bildernamen in Deutsch und Englisch anzuzeigen.

Ich habe den MOD gefunden http://www.4homepages.de/forum/index.php?topic=6749.0

Werde ihn die Woche mal ausprobieren. Auf den ersten Blick wirklich etwas undurchsichtig. Werde mal posten wie die Installation geklappt hat.

Bis dann

Steffen
Logged

Matthias70
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #71 on: September 19, 2005, 03:55:34 PM »

I'm using this extension (see code below) for Language Select.
My language-settings are saved for visitors by cookies.
May I somehow save the template-setting for the visitor - so he gets the template for his language, when visiting the page next time (well, unless he doesn't delete his cookies)
At the moment, the language is saved by cookie (code below) but the default_english or default_german folder is not saved...
So visitors which choose english language come back to my site. They see the english language-file but the german default-template.
Difficult I know, but perhaps somebody can understand and help me???

Matthias

on Lanuage select is it possible to for user to see another template??
let's say i have english and farsi
i want the user when he chooses the farsi to get a totally different template!

u'll need delete from global.php:
1
2
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
and this:
1
2
3
4
5
//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
include(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);

And then find:
1
include(ROOT_PATH.'lang/'.$config['language_dir'].'/main.php');
and insert above this:
1
2
3
4
5
6
7
8
if ($config['language_dir'] == $l) $config['template_dir'] .= "_".$l;
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
include(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);

With this change you will need create template for each language with this name format: <template name>_<language>
for example your default language is english and have also deutsch and spanish languages.
the default template used has name blah
Then you must have three templates with names:
blah
blah_deutsch
blah_spanish
Logged

Xyu BAM
Full Member
***
Offline Offline

Posts: 145

Thank You
-Given: 0
-Receive: 2


View Profile
« Reply #72 on: September 20, 2005, 01:43:31 AM »

the new code from first step in this topic:
http://www.4homepages.de/forum/index.php?topic=4743.msg31555#msg31555

try to move it above
1
if ($config['language_dir'] == $l) $config['template_dir'] .= "_".$l;
Logged
Matthias70
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #73 on: September 20, 2005, 03:38:42 PM »

the new code from first step in this topic:
http://www.4homepages.de/forum/index.php?topic=4743.msg31555#msg31555

try to move it above
1
if ($config['language_dir'] == $l) $config['template_dir'] .= "_".$l;

Hi, I have some problems with your suggestion.
The relevant code from my global.php looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$config['language_list'] = "(".implode("|", $config['language_list_array']).")";
if (isset($HTTP_GET_VARS['l']) || isset($HTTP_POST_VARS['l'])) {
  $l = (isset($HTTP_GET_VARS['l'])) ? trim($HTTP_GET_VARS['l']) : trim($HTTP_POST_VARS['l']);
  if (file_exists(ROOT_PATH.'lang/'.$l.'/main.php')) {
    $config['language_dir'] = $l;
    setcookie('4images_lang', $l, (time()+ 60 * 60 * 24 * 365), "/", "", 0);
  }
}
else
{
  if (isset($HTTP_COOKIE_VARS['4images_lang']) && file_exists(ROOT_PATH.'lang/'.$HTTP_COOKIE_VARS['4images_lang'].'/main.php'))
  {
    $config['language_dir'] = $HTTP_COOKIE_VARS['4images_lang'];
  }
}
if ($config['language_dir'] == $l) $config['template_dir'] .= "_".$l;
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");


What should I change?
Matthias
Logged

Xyu BAM
Full Member
***
Offline Offline

Posts: 145

Thank You
-Given: 0
-Receive: 2


View Profile
« Reply #74 on: September 21, 2005, 12:56:15 AM »

oh, I see...
what if you replace
1
    $config['language_dir'] = $HTTP_COOKIE_VARS['4images_lang'];
with:
1
    $l = $config['language_dir'] = $HTTP_COOKIE_VARS['4images_lang'];
Logged
Pages: «« « 1 2 3 4 [5] 6 7 8 9 ... 16 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.142 seconds with 20 queries.