• [MOD] Language select 4 0 5 1
Currently:  

Author Topic: [MOD] Language select  (Read 297360 times)

0 Members and 1 Guest are viewing this topic.

Offline TXtaholic

  • Jr. Member
  • **
  • Posts: 67
  • life is ours we live it our way!
    • View Profile
    • i MMS u
Re: [MOD] Language select
« Reply #45 on: May 10, 2005, 09:02:07 AM »
thank u vano really thank u i will never loose this code again lol i printed it out :D

Offline TXtaholic

  • Jr. Member
  • **
  • Posts: 67
  • life is ours we live it our way!
    • View Profile
    • i MMS u
Re: [MOD] Language select
« Reply #46 on: May 10, 2005, 10:57:17 AM »
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:
Code: [Select]
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
And then find:
Code: [Select]
include(ROOT_PATH.'lang/'.$config['language_dir'].'/main.php');and insert above this:
Code: [Select]
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");

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


P.S. I've removed your page_header.php source, so it wont cloag up the search engine ;) next time if u want to show something like, attach the file as a .txt file ;) (or zip it)

i have this error
Template Error: Couldn't open Template-Pack TEMPLATE_PATH

you may view the gobal if it is ok with u the link it listed bleow
http://immsu.com/global.phps

Note: it's on a fresh 1.7.1 file!!!

and also  i have uploaded the old golbal where the code is working fine  8O
u may please view it here
http://immsu.com/oldglobal.phps




Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #47 on: May 10, 2005, 02:26:37 PM »
sorry, my bad. I've updated the my post.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline TXtaholic

  • Jr. Member
  • **
  • Posts: 67
  • life is ours we live it our way!
    • View Profile
    • i MMS u
Re: [MOD] Language select
« Reply #48 on: May 12, 2005, 04:17:55 PM »
thank you v@no
prefect it's working

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #49 on: July 10, 2005, 07:05:23 PM »
#p.s. i paste the code on line 129 a shown above.....
where?
please show 3 lines above and 3 lines below the "error" line.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #50 on: July 10, 2005, 08:54:43 PM »
I dont see anything wrong with the code u've showed...perhaps u've made a mistake somewhere else.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline IWS_steffen

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Kreuzfahrtschiffe gestern und heute
Re: [MOD] Language select
« Reply #51 on: August 27, 2005, 11:11:52 PM »
Hi 4images Gemeinde

Der MOD klappt super. Auch mit 1.7.1.
Die Gallery wechselt ohne Probleme die Sprachen.

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

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Language select
« Reply #52 on: September 10, 2005, 07:52:43 PM »
Quote
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

Hi V@no I've a small problem, with this  :wink:

On my site deutsch is the default language, but I don't need three templates but four  :roll:
When I'm using only three templates, I'm asked for blah_deutsch
So I need four templates like this

blah (Default deutsch)
blah_deutsch
blah_english
blah_spanish[/b]

What do I have to change to get rid of the
blah_deutsch or is everythin O.K.

???

Matthias

TheOracle

  • Guest
Re: [MOD] Language select
« Reply #53 on: September 10, 2005, 10:38:01 PM »
Quote

What do I have to change to get rid of the
blah_deutsch


My personal thanks for requesting this. I have just found out how to do so. ;)

In your includes/page_header.php file,

find :

Quote

while ($folder = @readdir($handle)) {


add below :

Code: [Select]

if ($folder != "blah_deutsch") {


Note : I assume your blah_deutsch folder is definitely not the actual name folder. Simply rename the name from the quote initial. ;)

Then, find :

Quote

$lang_select .= ">".$folder."</option>\n";   
  }
}


replace with :

Code: [Select]

$lang_select .= ">".$folder."</option>\n";
    }
  }
}


Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Language select
« Reply #54 on: September 10, 2005, 11:58:46 PM »
Hhmm, my page_header.php code looks like this :?:

Code: [Select]
$lang_select = "";
while ($folder = @readdir($handle)) {
 if (@is_dir(ROOT_PATH."lang/".$folder) && $folder != "." && $folder != "..") {
   if ($folder != $config['language_dir']) {
     $lang_select .= "<a class=\"lang\" href=\"".$lang_url.(preg_match("/english/i",$folder) ? "" : ((preg_match("/\?/", $lang_url) ? "&" : "?")."l=".$folder))."\" onMouseOver=\"(window.status='$folder'); return true\" onMouseOut=\"window.status=''; return true\"><img src=\"".TEMPLATE_PATH."/images/".$folder.".gif\" border=\"0\" alt=\"".$folder."\"></a>&nbsp;";
   }else{
   $lang_select .= "<img src=\"".TEMPLATE_PATH."/images/".$folder."2.gif\" border=\"0\" alt=\"".$folder."\">&nbsp;";
   }
 }
}

TheOracle

  • Guest
Re: [MOD] Language select
« Reply #55 on: September 11, 2005, 12:56:38 AM »
Ok. Let's try this one more time.

Find :

Quote

while ($folder = @readdir($handle)) {

  if (@is_dir(ROOT_PATH."lang/".$folder) && $folder != "." && $folder != "..") {

    $lang_select .= "<option value=\"".$folder."\"";

    // If the folder name matches the current language,
    // show the option as selected

    if ($folder == $config['language_dir']) {
      $lang_select .= " selected=\"selected\"";
    }

    $lang_select .= ">".$folder."</option>\n";
  }
}

$lang_select .= "</select>\n</form>";


replace with :

Code: [Select]

while ($folder = @readdir($handle)) {

if ($folder != "blah_deutsch") {

  if (@is_dir(ROOT_PATH."lang/".$folder) && $folder != "." && $folder != "..") {

    $lang_select .= "<option value=\"".$folder."\"";

    // If the folder name matches the current language,
    // show the option as selected

    if ($folder == $config['language_dir']) {
      $lang_select .= " selected=\"selected\"";
    }

    $lang_select .= ">".$folder."</option>\n";
    }
  }
}

$lang_select .= "</select>\n</form>";


Remember to modify the blah_deutsch inside the quotes.

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Language select
« Reply #56 on: September 11, 2005, 01:30:37 AM »
Hi TheOracle
it does'nt work.

But you are although on the wrong way.
I dont have a problem with the language folder but a problem with the different template folders for different languages

I have a template language folder for english and a template language folder for german.
It's just an addon for the language select mod

Matthias

TheOracle

  • Guest
Re: [MOD] Language select
« Reply #57 on: September 11, 2005, 01:34:30 AM »
Quote

But you are although on the wrong way.


The other way around - look at the topic subject and what you requested. It would seems that it is you who posted on the wrong topic. There's a topic called : ' Members Templates select ' since it looks like you're looking for to customize a template folder selection rather than a language folder.

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Language select
« Reply #58 on: September 11, 2005, 01:43:45 AM »
Hi theOracle
I mean this part in the mod language select
http://www.4homepages.de/forum/index.php?topic=4743.msg35908#msg35908

Matthias

TheOracle

  • Guest
Re: [MOD] Language select
« Reply #59 on: September 11, 2005, 02:06:52 AM »
Ah ! I see. ;)

It has already been integrated in the past. Thanks for advising.

Unfortunitely, I cannot give a response on this one at this time since I did not inspect this part of the MOD closely yet.