I-MAXI Posted June 24, 2009 Report Posted June 24, 2009 Hello at all, I'm Marco an Italian boy, i'm 16 years old and my passion is fly. I'm a student at 3rd year of Aeronautics Technical Institute in Bari (Italy, Puglia). I had a Virtual Airline many month ago Adriatica Airlines (OnLine for 1 year). My hobby are many, but I prefer web developing, especially using Joomla! a contenent management system Open Source, Simple Machine Forum 1.1.x, mybb 1.4.x, and i have 3 years of experience with these tools. But my PHP level is basic, because i work with HTML and Joomla Framework. I have discovered this wonderful tool and I want to partecipate to improve this tool. So i'm developing a Multi-Language System and Italian Language for phpVMS. Tomorrow i will leave my first page of admin panel that contains my system and the core system. Marco Quote
Strider Posted June 24, 2009 Report Posted June 24, 2009 Just a word of warning, anything you do to the admin panel will be changed in an update. Cheers Dan C Quote
Administrators Nabeel Posted June 25, 2009 Administrators Report Posted June 25, 2009 Hey, Welcome! I'm looking into doing some translation class or service, so that would help. I will let you know Quote
I-MAXI Posted June 25, 2009 Author Report Posted June 25, 2009 I can continue my work? Now I'm working on lang_core.php. However my system works like this: there are one new folder called "lang", in this folder there are, lang_core.php and one o more $lang.php (e.g. en-en.php, it-it.php....) lang_core.php This determines the nationality of the user using $_SERVER['HTTP_ACCEPT_LANGUAGE'] method and creating a cookie in the user PC containing language id, (e.g. en-us, it-it, en-en). So, in every page lang_core.php reads the cookie content and insert the value in a variable $lang and select the respective $lang.php file which contains the variables with string translated. Is it possible my idea? $lang.php <?php //it-it //Italian language //translated by Marco Carbone $Unauthorized_access = 'Accesso non autorizzato!'; $Graph_Title_Pireps_filed = 'Pireps Compilati'; $Install_folder_exist_security_risk = 'La cartella d'installazione esiste ancora! Questo crea un rischio di sicurezza elevato. Eliminalo subito!'; $Unable_to_connect_to_phpvms_server_to_update = '<br /><b>Errore:</b> Il server di aggiornamento phpVMS non può essere contattato. Assicurati che allow_url_fopen sia ON nel php.ini, o che il module cURL sia installato (contatta il tuo host).'; $phpVMS_Version = '/^.*Versione: (.*)</span>/'; $phpVMS_Version_Available = 'Versione '; $phpVMS_Version_is_Available = ' è disponibile per il download! Aggiorna ASAP'; $Add_Download_Category = 'Aggiungi categoria'; $Add_Download = 'Aggiungi Download'; $Va_Stats = 'Statistiche Virtual Airline'; $Total_Pilots = 'Totale Piloti: '; $Total_Flights = 'Totale Voli: '; $Total_Hours_Flown = 'Totale ore di volo eseguite: '; $Latest_News = 'Ultime notizie'; $Administration_Panel = 'Pannello di amministrazione'; $Pilot_Reports_for_Week = 'Rapporti dei piloti della settimana scorsa'; Work in progress ?> So, to work this system have to include this: include ("../lang/lang_core.php"); include ("../lang/$lang.php"); in every page, and the content must be variable, for example: ... # Create the chart //$reportcounts = ''; $reportcounts = PIREPData::ShowReportCounts(); if(!$reportcounts) { $reportcounts = array(); } include ("../lang/lang_core.php"); include ("../lang/$lang.php"); $graph = new ChartGraph('pchart', 'line', 680, 180); $graph->setFontSize( 8 ) ; $graph->AddData($reportcounts, array_keys($reportcounts)); $graph->setTitles($Graph_Title_Pireps_filed); $graph->GenerateGraph(); ... Marco Update: I have just finish to write lang_core.php, this is the code: <?php $lang_id = mb_substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0, -30, 'UTF-8'); $Host = $_SERVER['HTTP_HOST']; setcookie($Host, $lang_id, time()+86400); $lang_name = $_COOKIE[Host]; ?> but there are some errors.... 1)Warning: Cannot modify header information - headers already sent by (output started at C:xampphtdocsphpvmscoreclassesTemplateSet.class.php:221) in C:xampphtdocsphpvmslanglang_core.php on line 6 2)Warning: include(../lang/.php) [function.include]: failed to open stream: No such file or directory in C:xampphtdocsphpvmsadminmodulesDashboardDashboard.php on line 99 Warning: include() [function.include]: Failed opening '../lang/.php' for inclusion (include_path='.;C:xamppphppear') in C:xampphtdocsphpvmsadminmodulesDashboardDashboard.php on line 99 3)Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:xampphtdocsphpvmsadminindex.php:53) in C:xampphtdocsphpvmscorecodon.config.php on line 40 4)Warning: include() [function.include]: Failed opening '../lang/.php' for inclusion (include_path='.;C:xamppphppear') in C:xampphtdocsphpvmsadmintemplatesdashboard.tpl on line 5 but the second, third and fourth errors after a page reload, disappears, but only using Mozilla Firefox... :-[ Quote
Administrators Nabeel Posted June 26, 2009 Administrators Report Posted June 26, 2009 I will be building into the core Codon code, so it will be a bit different, through the core classes etc, not individual includes. If you can wait a bit, after I get some other things out of the way... Quote
I-MAXI Posted June 26, 2009 Author Report Posted June 26, 2009 How i can help you? If possible... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.