Reply to Re: Is This A Good Structure For What I Am Trying To Achieve With The Languages?

Your name:

Reply:


Posted by C. on 09/29/10 12:00

On 16 Jan, 13:41, adam.timberl...@gmail.com wrote:
> hello everybody
>
> i have been reading the article below in case you are wondering, but i
> have myself a question about how good the structure really is, and if
> there are any better ways to do this.
>
> article:http://www.talkphp.com/vbarticles.php?do=article&articleid=46
>
> i do like how that site has done it but as i dont know alot about php,
> i cant tell whether its a good solution or not, so could somebody
> please tell me if it is ?? if it is accepable then i shall it :)
>
> thank you and good night!

The code structure is OK but the pattern of directories an mapping one
page to one datafile seems like overkill and introduces a lot of
redundancy. Also, having to parse XML for every page hit is an
overhead. Certainly it makes like simple if you use your native
language versions of phrases to index other languages.

Personally, I've preferred going for a relational database to hold the
structures in, say something like...

create table phrases (
phrase_id integer not null,
language varchar(5),
phrase clob,
primary key phrase_id,
index language
}

then....

SELECT IFNULL(target.phrase, native.phrase)
FROM phrases native LEFT JOIN phrases target ON
native.phrase_id=target.phrase_id
WHERE native.phrase='$search_phrase'
AND native.language='en_GB';

(this is a rough hack - assumes you can allocate phrase_ids and link
them, also, without a CLOB index it won't scale well)

C.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация