Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Add multilenguage option #12

Open
avs-code opened this issue Oct 5, 2016 · 2 comments
Open

Add multilenguage option #12

avs-code opened this issue Oct 5, 2016 · 2 comments

Comments

@avs-code
Copy link
Owner

avs-code commented Oct 5, 2016

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:

  1. Put separate releases for each translated language. The user downloads PREM in the language available that he wants.
  2. Make a single multi language web, using strings, definitions, etc.
@avs-code avs-code added this to the v1.1 milestone Oct 5, 2016
@avs-code
Copy link
Owner Author

avs-code commented Nov 29, 2016

TASKS

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

@avs-code avs-code modified the milestones: v1.2.0, v1.1.0 Dec 3, 2016
@avs-code
Copy link
Owner Author

avs-code commented Dec 3, 2016

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
?>

@avs-code avs-code removed this from the v1.2.0 milestone Dec 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant