MySQL Forums
Forum List  »  Newbie

Building multilingual site
Posted by: Joe McDermott
Date: March 07, 2008 04:02AM

I am building a multilingual CMS, where you can create a page and store as many different language versions of content for that page as you like.

The structure is a little like this (massively simplified obviously):

Page table: page_id, page_address
Page language table: langpage_id, langpage_page_id, langpage_content
Language table: lang_id, lang_title

You can visit a page using the page_address as a URL, and then the content is displayed depending on which lang_id that user currently has set in his session cookie, and the correct language content displayed.


The problem:
I want a default language to be used if there is no content available for another language, and I am looking for an efficient way of achieving this... Currently using a query like this:

select * from page
JOIN language ON lang_id=users_session_lang_id
JOIN pagelanguage ON langpage_id=lang_id

will cause an empty result as there is no lang content for that page.

Thoughts?

Options: ReplyQuote


Subject
Written By
Posted
Building multilingual site
March 07, 2008 04:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.