0

I found a seemingly appropriate solution. Could anyone provide a clear example of this option? I think it seems suitable but I don't really get it.

CREATE TABLE T_PRODUCT (
  NAME_FK        int,
  DESCRIPTION_FK int,
  PRICE          NUMBER(18, 2)
)

CREATE TABLE T_TRANSLATION (
  TRANSLATION_ID
)

CREATE TABLE T_TRANSLATION_ENTRY (
  TRANSLATION_FK,
  LANGUAGE_FK,
  TRANSLATED_TEXT NTEXT
)

CREATE TABLE T_TRANSLATION_LANGUAGE (
  LANGUAGE_ID,
  LANGUAGE_CODE CHAR(2)
)

Also if I only intend to provide localization for menuses and links all over my website, should I proceed with this approach? Is that too complicated for my purpose (not translating any data content)?

Duc Tran
  • 6,016
  • 4
  • 34
  • 42
  • You might want to take a look at this question for a lot more to think about before you decide to just internationalize part of your site: http://stackoverflow.com/questions/644100/design-considerations-for-internationalization – Benny Hill Dec 06 '12 at 22:45

1 Answers1

0

PHP Has actually a library built to support this.

GetText

I've used it before and it actually works pretty slick.

Here are a list of the functions:

GetText Functions

Petrogad
  • 4,405
  • 5
  • 38
  • 77
  • is that ok if I use the database, as GetText requires restart apache each time changing the .po file – Duc Tran Dec 07 '12 at 09:52
  • You can; however then you add an extra layer in of a database.. just makes it so that everytime you hit a page you have to re-query all of your localizations.. which will inevitably slow things down. – Petrogad Dec 07 '12 at 10:58
  • Here's a question that answers how to update .po files without restarting Apache: http://stackoverflow.com/questions/13625659/how-to-clear-phps-gettext-cache-without-restart-apache-nor-change-domain – Benny Hill Dec 07 '12 at 18:12