views:

52

answers:

1

Hi, i am working on a site to include Multilingual Support. I can translate strings using Zend_Translate but what about the content?? For example do i have to add multiple records for same product's for each language? Or is there any other way? I am new to multilingual please help. Thanks in advance.

--- Addition -----------------------------

Ok, i decided to use a mixed solution to use google translation api and storing it in database for further editing. So what sould be the structure of database to store translations???

  1. Should i save translations of different language in same table as parent record. i.e. for product in product table with an extra column to identity language.
  2. A generalized single table to store all translations of all tables. e.g. translations (id bigint,table_name vc(50),table_id bigint, langugae, column_name vc(50), translation )

should i save records in related tables

+4  A: 

Few possible approaches:

  1. Using gettext (or software like Poedit) to extract the data from the content. Possible with variable interpolation.
  2. Creating view filter like described in: Zend Framework and Translation
  3. Have separate content of the data in the database.
    If you store the content in markup (e.g. Markdown) format, anyone can translate it easily. It's easy to create search engine in different languages.

Seems the third approach requires the most efforts, but it is worth.

Update after comment

I assume you store your product data in the database, in fields like:

- product_data
-- id
-- price
-- name
-- description
-- etc…

So you should modify it, to add fields for translated strings in each language:

- product_data
-- id
-- price

- product_data_translations
-- product_id
-- language (e.g. en)
-- name
-- description
-- etc

Then you can easily build SQL queries to extract translated data where product_id=x and language="fr".

You may use also Doctrine I18N to do it for you automatically.

You need to translate the content manually (or automate the translation using Google API), but then, you can easily index it using for example Zend_Search_Lucene.

takeshin
It shouldn't be gettext OR Poedit, it should be gettext AND Poedit. Poedit is just a gettext client, you will still need gettext to get the text ;-).
tharkun
@tharkun Right, but I ment just command line `gettext`, not the technology called *gettext™*
takeshin
+1 @takeshin thanks bro for your response but i did not get your third point fully, please can you explain.
Imran Naqvi
@Imran I have updated the answer. Hope it's more clear now.
takeshin
@takeshin, Well thanks, i got it now.
Imran Naqvi
@takeshin, But i hope i could find something new, i will probably accept your answer after getting some more responses.
Imran Naqvi