Concluído

Autodetectar idioma som sites já com páginas traduzidas

Ola Pessoal, Eu tenho um site que já tem alguns idiomas, o [url removed, login to view] , mas ele não detectar automaticamente o idioma automaticamente e queria saber se alguém sabe como fazer isso, alguém pode me ajudar? Vou passar algumas páginas de código:

**INCLUDE/CONFIG:**

`<?

$config = array();

// Begin Configuration

$config['basedir'] = '---';

$config['baseurl'] = '---';

$default_language = "english"; //Valid options are english, french, spanish, portuguese, japanese, chinese_simplified or chinese_traditional

// End Configuration

session_start();

date_default_timezone_set('America/New_York');

$config['adminurl'] = $config['baseurl'].'/administrator';

$config['cssurl'] = $config['baseurl'].'/css';

$config['imagedir'] = $config['basedir'].'/img';

$config['imageurl'] = $config['baseurl'].'/img';

$config['pdir'] = $config['basedir'].'/pics';

$config['purl'] = $config['baseurl'].'/pics';

$config['mdir'] = $config['basedir'].'/mpics';

$config['murl'] = $config['baseurl'].'/mpics';

echo file_get_contents($config['baseurl']."/[url removed, login to view]");

require_once($config['basedir'].'/smarty/libs/[url removed, login to view]');

function strip_mq_gpc($arg)

{

$arg = str_replace('"',"'",$arg);

$arg = stripslashes($arg);

return $arg;

}

$conn = &ADONewConnection($DBTYPE);

$conn->PConnect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME);

@mysql_query("SET NAMES 'UTF8'");

$sql = "SELECT * from config";

$rsc = $conn->Execute($sql);

if($rsc){while(!$rsc->EOF)

{

$field = $rsc->fields['setting'];

$config[$field] = $rsc->fields['value'];

STemplate::assign($field, strip_mq_gpc($config[$field]));

@$rsc->MoveNext();

}}

if ($_REQUEST['language'] != "")

{

if ($_REQUEST['language'] == "english")

{

$_SESSION['language'] = "english";

}

elseif ($_REQUEST['language'] == "french")

{

$_SESSION['language'] = "french";

}

elseif ($_REQUEST['language'] == "spanish")

{

$_SESSION['language'] = "spanish";

}

elseif ($_REQUEST['language'] == "portuguese")

{

$_SESSION['language'] = "portuguese";

}

elseif ($_REQUEST['language'] == "japanese")

{

$_SESSION['language'] = "japanese";

}

elseif ($_REQUEST['language'] == "chinese_simplified")

{

$_SESSION['language'] = "chinese_simplified";

}

elseif ($_REQUEST['language'] == "chinese_traditional")

{

$_SESSION['language'] = "chinese_traditional";

}

}

if ($_SESSION['language'] == "")

{

$_SESSION['language'] = $default_language;

}

if ($_SESSION['language'] == "english")

{

include("lang/[url removed, login to view]");

}

elseif ($_SESSION['language'] == "french")

{

include("lang/[url removed, login to view]");

}

elseif ($_SESSION['language'] == "spanish")

{

include("lang/[url removed, login to view]");

}

elseif ($_SESSION['language'] == "portuguese")

{

include("lang/[url removed, login to view]");

}

elseif ($_SESSION['language'] == "japanese")

{

include("lang/[url removed, login to view]");

}

elseif ($_SESSION['language'] == "chinese_simplified")

{

include("lang/[url removed, login to view]");

}

elseif ($_SESSION['language'] == "chinese_traditional")

{

include("lang/[url removed, login to view]");

}

else

{

include("lang/".$default_language.".php");

}

for ($i=0; $i<count($lang); $i++)

{

STemplate::assign('lang'.$i, $lang[$i]);

}

if($config['re_mobile'] == "1" && $config['m_url'] != "")

...

-------------------------------------------------------------------

**e tem as paginas de idiomas no include/lang, veja um exemplo da English:**

<?

$lang = array();

$lang['0'] = "Login";

$lang['1'] = "Home";

------------------------------------------------------------------

Tem também Portuguese, Spanish, Japanese

I found on header_menu.php

<div class="nav sysOutLink"><a href="javascript:void(0)" {literal}onclick="App.ajaxDialog('{/literal}{$baseurl}{literal}/language.php', {id: 'sysLangPopup', width: '550px'})"{/literal}>{if $smarty.session.language eq "english"}English{elseif $smarty.session.language eq "spanish"}Español{elseif $smarty.session.language eq "french"}Français{elseif $smarty.session.language eq "portuguese"}Português{elseif $smarty.session.language eq "japanese"}日本の{elseif $smarty.session.language eq "chinese_simplified"}中文(简体){elseif $smarty.session.language eq "chinese_traditional"}中國傳統文化{/if}</a></div>

Habilidades: Marketing na Internet, Link Building, MySQL, PHP, SEO

Veja mais: marketing pessoal, sql marketing, spanish o english, tem, spanish japanese, Spanish english japanese, som, sabe, portuguese seo, Paginas, idiomas, eof, ele, arg, css startup, echo lang, names spanish, seo config, sites french, php elseif

Acerca do Empregador:
( 1 comentário ) Santos, Brazil

ID do Projeto: #5562592

Concedido a:

joaolucas89

Ainda não foi fornecida uma proposta

£33 GBP em 1 dia
(5 Comentários)
4.1

2 freelancers estão ofertando em média £26 para esse trabalho

technosolve2

Dear Sir, we are pleased to inform you that we have studied all the requirements and can deliver the same to u .we already have similar work experience and have worked on similar projects in the past and can deliver Mais

£22 GBP em 1 dia
(0 Comentários)
0.0
bobfrye008

A proposal has not yet been provided

£18 GBP em 1 dia
(0 Comentários)
0.0