Few possible approaches:
- Using
gettext
(or software like Poedit) to extract the data from the content. Possible with variable interpolation.
- Creating view filter like described in: Zend Framework and Translation
- 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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…