como hacer tu blog o pagina web multi-language sin multiples archivos

buenos dias, buenas tardes o noches hoy os vengo a mostrar como hacer nuestras paginas o blogs multi lenguaje sin tener que hacer multiple archivos.


1. agregamos:

function MessagePlayer( $lang_1, $lang_2 )
{
$lang_selection = "lang1"; //aqui cambiaremos esto por una db que guardara el idioma del user
$lang_choosed;
if ( $lang_selection == "lang1" ) {
$lang_choosed = $lang_1;
}
else if( $lang_selection == "lang2" ) {
$lang_choosed = $lang_2;
}
return $lang_choosed; // returning language took;
}




 
en su archivo .php

2. agregamos

MessagePlayer( 'texto 1', 'texto 2 ' );

y si hicieron todo bien el output o salida sera segun el idioma.

si es el idioma 1. sera [ texto 1 ]
si es el idioma 2. sera [ text 2 ] 

Share on Google Plus

About ANONIMOUS

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment