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

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

0 Members and 1 Guest are viewing this topic.

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Language select
« Reply #195 on: October 28, 2009, 11:34:05 AM »
I want to show one part of page only if choose russian language. How to do this?
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.

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 #196 on: October 28, 2009, 01:42:48 PM »
use something like this:
Code: (HTML template) [Select]
<?php
global $config;
if (
$config['language_dir'] == "russian")
{
?>


this text/html will be only visible when selected russian


<?php
}
?>


P.S.
if you are planning add this code more then once in the same template, leave global $config; only at first instance, it only needed once
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 shadowhunter

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Fotogalerie & Fotocommunity scluzern.com
Re: [MOD] Language select
« Reply #197 on: February 16, 2010, 03:55:54 PM »
Hello!

I use this MOD with version "B" (images) and I have a question:

Is it possible to add the cookies based version (http://www.4homepages.de/forum/index.php?topic=4743.msg31555#msg31555 ) with this little extra modification:

URLCOOKIE VALUE
index.php"deutsch"  or  "" [no cookie]
index.php?l=english"english"
index.php?l=french"french"
--> German (deutsch) is my default language!
--> I don't want to have the "?l=deutsch" at the end uf the url if default language is selected.


The original posted version is like this:
URLCOOKIE VALUE
index.php?l=deutschdeutsch
index.php?l=englishenglish
index.php?l=frenchfrench


I have the following code in page_header.php:
Code: [Select]
$lang_select .= "<a class=\"lang\" href=\"".$lang_url.(preg_match("/deutsch/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;";

Can anyone help me please?
Thanks in advance!
Greetings

Offline _qp_

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [MOD] Language select
« Reply #198 on: April 02, 2010, 06:16:44 PM »
And i have a question: is it possible in the mod to remove showing this part (red) in the url and still have the language selection working?

index.php?l=english
index.php?l=russian

?

So it would change the language and show just index.php without the language part in the url?

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 #199 on: July 17, 2010, 12:19:26 AM »
http://www.4homepages.de/forum/index.php?topic=4743.msg31555#msg31555

I just updated the code and added a new step for sessions.php

Note, the l=blah will be displayed right after the language switched.
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 alex9193

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: [MOD] Language select
« Reply #200 on: July 17, 2010, 01:54:29 AM »
Hi V@no, could you please help me with my problem?
For example: if you change language eng -> rus, URL нisn't changed (picture 1),
but if you change language rus -> eng, Url is chaged for a russian one (picture 2)??????

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 #201 on: July 17, 2010, 02:42:41 AM »
I think you got it backwards.
eng -> rus = url changed
rus -> eng = no url changed.
This is done that way because your gallery's default language is english, therefor no point adding l=english to the url.

if you don't like that way and want always have l=english, then replace in sessions.php
$l null;

with:
$l $config['language_dir'];
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 alex9193

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: [MOD] Language select
« Reply #202 on: July 17, 2010, 08:04:45 AM »
V@no.
You probably didn't understand me.  :)
The problem is URL body itself isn't changed.
If you chanage ENG -> RUS (somewhere not on index page) URL isn't changed to RUS
(URL is just added by ?l=russian - http://max-pix.com/cat-alsou-1378.htm?l=russian), and after if you change RUS to some other language 
(German or English) URL body is chaged to RUS for some reason - http://max-pix.com/cat-Алсу-1378.htm?l=deutsch.

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 #203 on: July 17, 2010, 05:58:08 PM »
That's because how it works, it will no change url name to russian until it already switched to russian, not before.
What you are trying do is to show url when however over language select icon in the language you are about to switch to - this is never going to happen, and besides, that is more related to the SEO mod you are using ;)
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 alex9193

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: [MOD] Language select
« Reply #204 on: July 20, 2010, 09:58:22 PM »
V@no? спасибо за раз'яснения!
Последний вопрос  :D, а можно сделать так, чтобы переключение на всех страницах работало как на главной, (переключаешь язык и тебя на главную кидает, что-бы боты по этим неправильным урлам не ходили)
А то у меня столько дублей получается - три языка + вариации с урлами!  8O

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 #205 on: July 21, 2010, 02:19:03 AM »
Да, очень просто делается:
В /includes/page_header.php замените
$lang_url $site_sess->url($PHP_SELF.$query_string'&');


На это:
$lang_url $site_sess->url(ROOT_PATH."index.php""&");
« Last Edit: July 21, 2010, 08:09:22 AM by V@no »
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 alex9193

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: [MOD] Language select
« Reply #206 on: July 21, 2010, 05:14:29 AM »
Попробовал, все равно получается каша, например переключился с английского по умолчанию на русский, теперь:
Ссылка переключения на немецкий такая http://...../?l=russian&l=deutsch
на английский такая http://...../?l=russian
Мистика :lol:

Вот здесь посмотреть можно http://max-pix.com/search.htm
« Last Edit: July 21, 2010, 06:49:30 AM by alex9193 »

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 #207 on: July 21, 2010, 08:10:55 AM »
Ой что-то я об-этом не подумал..исправил мой предыдущий ответ. Удалите предыдущие изменения, а потом измените только одну линию.
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 alex9193

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: [MOD] Language select
« Reply #208 on: July 21, 2010, 01:56:44 PM »
Сасибо V@no! Работает.  :)

Offline relu

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Pulsarmedia
Re: [MOD] Language select
« Reply #209 on: October 01, 2010, 06:33:22 PM »
How about to make different fields in admin panel with title and description for each language?
Is possible to select diferent languages without changing url?
« Last Edit: October 01, 2010, 06:52:34 PM by relu »