0
Hello, I am developing a site that has only 4 pages, and I want to have it in at least six languages, but what should I do for it?
Even with a few pages, I need a lot of text, because the login page includes the field "country", which contains many countries for example! The idea is this:
I intend to create several files in a "language" folder, such as, "portuguese.inc.php", "Spanish.inc,php", "english.inc.php"....
And inside each file as an example:
// Account
$hello = "Olá";
$welcome = "Bem-Vindo";
$go_in = "Entre";
$or = "ou";
$sign_up = "Cadastre-se";
$sign_in = "Entrar";
$forgot_password= "Esqueceu a Senha?";
$logout = "Sair";
$my_account = "Minha Conta";
// Languages
$language = "Idioma";
$english = "Ingles";
$portuguese = "Português";
$spanish = "Espanhol";
$chinese = "Chinês";
$italian = "Italiano";
$german = "Alemão";
$french = "Francês";
$arabic = "Arabico";
$russian = "Russo";
$japanese = "Japonês";
And where will I use the files :
Index.php
<?php
include_once 'languages/portuguese.inc.php';
// Minha Conta
// Olá, Bem-Vindo!
// Entre ou Cadastre-se!
echo "$my_account";
echo "$hello $welcome!";
echo "$go_in $or $sign_up";
What do you think?
This is the best alternative?
Is there any consequence to it?
In case the translation will only occur in fixed words on the site? How to translate in case a description of a real estate site?
– Gladison Neuza Perosini
Yes, the above example is specific and more advisable for "fixed words", ie the Abels. Also called static content. But it can also be used for dynamic texts. It depends a lot on system data structure and requirements.
– Daniel Omine