Open avs-code opened 8 years ago
hay que declarar definiciones, y cada definición será una frase. Luego se hace un selector de lengua y dependiendo del lenguaje, se carga un fichero de constantes u otro
[ ] Declare definitions
[ ] Language selector
[ ] Constant file
Only work in this after 1.1.0 version
https://manuais.iessanclemente.net/index.php/T%C3%A9cnicas_y_consejos_para_crear_una_web_multi-idioma EXAMPLE: *index.php
<?php
header( 'Location: ./vam/index.php?lang=en' );
exit();
?>
<?php
if (isset ($_GET['lang']))
{
$_SESSION['language'] = $_GET['lang'];
}
if (isset($_SESSION['id'])) {
$user_logged = 1;
} else {
$user_logged = 0;
}
if (!isset($_GET['lang']) && $_SESSION['language'] == '') {
$_SESSION['language'] = "en";
}
if (isset($_GET['lang'])) {
$_SESSION['language'] = $_GET['lang'];
} elseif (!isset($_SESSION['language'])) {
$_SESSION['languages'] = "en";
}
include("./languages/lang_" . $_SESSION['language'] . ".php");
?>
*lang_en.php:
<?php
// NavBar options
define ('HOME' , 'HOME ');
define ('RESULTS' , 'RESULTS ');
etc
?>
*lang_es.php:
<?php
// NavBar options
define ('HOME' , 'INICIO ');
define ('RESULTS' , 'RESULTADOS ');
etc
?>
Keep in mind that most users will not have pay hostings. Must be friendly with free hostings (limitations on bandwith, Inodes Used, database size, etc).
I see two options: