类似于 Rosetta 的 PHP 翻译前端?

我目前正在将 Web 应用程序从基于数据库的国际化方法(每个词在翻译表中都有一个条目,以及实际翻译)迁移到基于 看起来方向正确,但太简单了 - 它没有' 似乎无法处理多种语言和目录以及复数形式.

解决方案

我还没有看到其他方案,可能有以下原因.尽管 SimplePO 网站上有这样的说法,但翻译人员不喜欢并且通常不会在如上所示的并行翻译系统上工作.

这就是程序员想象翻译器工作的方式,但这是有缺陷的.翻译人员使用名为 TMX 的工具包,翻译记忆交换(​​通用名称,请参阅开源实现 Okapi 以了解它),并在此构建单词、短语和句子的翻译词典.他们采用不同格式的文件并将其输入 TMX 软件,这使他们第一次通过 60%、70% 等翻译,但就像谷歌语言 API 在目标语言中的意义方面被严重破坏.

然后他们所做的是翻译 TMX 未处理的单词,添加到合乎逻辑的词典中,然后将其口语化,即使其在目标语言中起作用并使其具有意义.出于这个原因,翻译人员应该始终翻译成他们的母语.

他们这样做的原因有很多,a) 有意义且有效并减轻了他们的工作量,b) 因为他们按单词付费并且进行并排翻译不允许他们使用他们的工具并最大化他们的收入.

翻译人员想要的是一个你可以导出的格式的文件,他们可以导入和翻译,导出并发回给你导入.

文件格式可以是 csv、rtf、tmx、xliff、gettext,如果你阅读了 Symfony 框架文档,你会看到他们是如何做和处理的(我认为他们做得很好).

说了这么多,大约 8 年前,当我不得不用英语、法语、德语、匈牙利语和斯洛伐克语编写一个网站时,我和 SimplPO 做了同样的事情,只是写了我自己的并排应用程序允许这样做.但是,我们为其编写应用程序的公司在内部完成了所有自己的翻译,因此我们没有遇到翻译问题.当我们这样做时,我们编写了一个到 RTF 的导出和从 RTF 导入(这本身就是令人难以置信的),这样翻译器就可以像上面一样工作.

然而,SimplePO 是我见过的这个想法的唯一其他实现.Zend 等框架似乎认为您只是创建查找标签来替换单词和短语,而没有在应用程序中构建控制来管理流程.因此,它很快就会失控,维护起来既困难又昂贵.

大多数编写多语言网站的人实际上并没有这样做.他们编写一个主站点,然后复制、翻译并维护翻译版本.对我们来说,逻辑类型看起来很笨拙,但实际上非常有效.

它有效的原因之一是 i18n 和 l10n 与语言之外的许多其他东西有关.

  • 外观和感觉.盎格鲁撒克逊人喜欢冷色和 san serif 字体,西班牙裔人喜欢 Serif 字体和明亮的颜色.当您跨越其他文化时,您的期望在布局、类型、颜色等方面会大不相同.
  • 法语和某种程度上的德语比同等的英语长 30%,更冗长,因此您的布局很快就会陷入困境.

  • 闪族语言从右到左

  • 日语和其他不基于字母的语言可以从上到下运行 ltr rtl,有些甚至没有空格
  • 约会?美国、日本、英国、匈牙利各不相同
  • 货币和数字格式,别让我失望

很抱歉继续总结:- 对于简单的并排,只需自己编写,我花了大约两周的时间没有任何框架,并在我继续使用标签替换时解决了它.但是,再考虑一下你在做什么.仔细.

I'm currently migrating a web application from a database-based internationalization approach (each word having an entry in the translation table, and the actual translation) to one based on Zend_Translate and CSV files.

I need to provide a end-user friendly way to update those translations quickly and easily. Ideally, to minimize the risk of breaking stuff, users would not edit the CSV files directly, but be shown a nice form with fields.

Do you know a standalone, PHP-based, end-user compatible translation frontend that supports one of the adapters Zend_Translate has to offer - ideally gettext or csv?

Something like Python's/Django's Rosetta but in PHP? Rosetta does exactly what I need:

but I would very much like to stay with PHP here for server setup reasons.

SimplePO looks like it goes in the right direction, but is too simple - it doesn't seem to be able to handle multiple languages and catalogs, and plurals.

解决方案

I have not seen another one and probably for the following reason. In spite of what it says on the SimplePO web site translators do not like and often will not work on side by side translation systems as shown above.

That is how programmers imagine translators will work and it is flawed. Translators work with a toolkit called TMX, Translation Memory Exchange (generic name see Okapi an open source implementation to get a feel for it), and in this they build up translation dictionaries for words, phrases and sentences. They the take a file of varying formats and feed it into the TMX software, this gives them a first pass that is 60%, 70% etc translated but like Google language API horribly mangled in terms of making sense in the target language.

Then what they do is translate the words not dealt with by TMX, adding to the dictionaries where logical, and they colloquialise it, i.e. make it work in the target language and make sense of it. For this reason the translator should always be translating into their native language.

They do it this way for a number of reasons, a) it makes sense and works and reduces their work load and b) because they get paid by the word and to do side by side translation does not allow them to use their tools and maximise their income.

What translators want is a file in a format that you can export, they can import and translate, export and send back to you to import.

The files formats can be csv, rtf, tmx, xliff, gettext and if you read the Symfony framework docs you can see how they do it and handle it (they do a pretty good job in my opinion).

Having said all that i was in a similar position about 8 years ago when having to write a site in English, French, German, Hungarian and Slovakian and i did the same as SimplPO and simply wrote my own side by side application to allow this to be done. However the company we were writing the application for did all their own translation in house so we didn't hit the problem with translators. When we did we wrote an export to RTF and import from RTF (that in itself is mind boggling) so the translators could function as above.

However SimplePO is the only other implementation of the idea i have seen. The frameworks such as Zend seem to think you just create lookup tags to replace words and phrases and build no control into the application to manage the process. Consequently it soon gets out of hand and the maintenance of it becomes both difficult and expensive.

Most people who write multilingual web sites actually don't. They write a master site and then make a copy, translate it and maintain the translated version. It seems clunky to us logical types but is actually very effective.

One of the reasons it is effective is the i18n and l10n are about many other things than language.

  • Look and feel. Anglo saxons like cool colours and san serif typefaces, Hispanic peoples like Serif type faces and brighter colours. And as you cross other cultures the expectations vary wildly in layout, types, colours etc.
  • French and to some degree German is 30% longer, more verbose, than the equivalent English so you layout goes to hell in a hand basket real quick.

  • Semitic language run right to left

  • Japanese and other language that are not alphabet based can run ltr rtl top to bottom and some do not even have white space
  • dates? US, Japanese, UK, Hungarian as all different
  • currency and number formats, don't even start me off

Well sorry to go on and to summarise:- For simple side to side just write it yourself, took me about two weeks without any frameworks and working it out as i went along just use tag replacement. But any more and consider what you are doing. Carefully.

相关文章