avvllvva Posted January 10, 2010 Share Posted January 10, 2010 Hi all, Which is the simplest and easiest method to make a website multilingual, is it putting files in different folder for different languages? or something else ? any suggestions will be appreciated. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/187921-some-query-on-multilingual-website/ Share on other sites More sharing options...
ignace Posted January 10, 2010 Share Posted January 10, 2010 Build your website in one language it's IMO the best solution some use a setup like an PHP array and a table for translations of their pages and their blog posts, .. To many sources to maintain keep it all in your database. If the user selects a language then translate everything that has a translation in the translation table. create table language ( id integer not null auto_increment, name varchar(32), -- Dutch (for back-end) name_translated varchar(32), -- Nederlands (for front-end) code char(2), -- nl unique language_code_un (code), primary key (id)); create table translation ( id integer not null auto_increment, language_id integer, message text, -- message as typed on the website message_translated text, -- translated version key translation_language_id_fk (language_id), primary key (id)); Now on your website: <a href=".." title="<?php print translate('Return to the frontpage');?>"><?php print translate('Frontpage');?></a> Your function translate remembers the language of the user (cookie otherwise HTTP_ACCEPT_LANGUAGE or system settings eg English). SELECT t2.* FROM language t1 JOIN translation t2 ON t1.id = t2.language_id WHERE t1.code = $code Quote Link to comment https://forums.phpfreaks.com/topic/187921-some-query-on-multilingual-website/#findComment-992260 Share on other sites More sharing options...
JAY6390 Posted January 10, 2010 Share Posted January 10, 2010 http://www.codingforums.com/showpost.php?p=908407&postcount=3 Quote Link to comment https://forums.phpfreaks.com/topic/187921-some-query-on-multilingual-website/#findComment-992263 Share on other sites More sharing options...
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.