---加法-----------------------------
好吧,我决定使用混合解决方案来使用google translation api并将其存储在数据库中以供进一步编辑.那么存储翻译的数据库结构到底是什么呢???
我应该将记录保存在相关表中
解决方案几种可行的方法:
似乎第三种方法需要最多的努力,但这是值得的.
评论后更新我假设您将产品数据存储在数据库中,例如:
- product_data -- id -- price -- name -- description -- etc…因此,您应该对其进行修改,以为每种语言的翻译字符串添加字段:
- product_data -- id -- price - product_data_translations -- product_id -- language (e.g. en) -- name -- description -- etc然后,您可以轻松地构建SQL查询以提取翻译后的数据where product_id=x and language="fr".
您也可以使用教义I18N 为您自动完成.
您需要手动翻译内容(或使用Google API自动翻译内容),但是您可以使用例如 Zend_Search_Lucene .
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???
should i save records in related tables
解决方案Few possible approaches:
Seems the third approach requires the most efforts, but it is worth.
Update after commentI 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 -- etcThen 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.
更多推荐
Zend框架中的多语言站点
发布评论