i18n à 的开源项目脸书
Facebook 对其网站本地化采用了这种独特而巧妙的方法:翻译人员(在他们的情况下是自愿帮助翻译网站的用户)只需单击其网站中尚未翻译的字符串(标有绿色底部边框)即可。网站上的自然环境。请参阅 http://www.facebook.com/translations/。
现在,如果您曾经需要处理网站的翻译,您就会清楚地意识到,当使用 poedit 等工具时,其中一些翻译是多么奇怪和有趣,因为译者并不完全意识到翻译的位置字符串将出现在网站上。
示例:请翻译“Home”。例如,在德语中,网站的起始页是“Home”,而您居住的房子是“Heim”。现在,作为翻译者,您基本上必须猜测该术语可能出现在网站上的哪个上下文中,并进行相应的翻译。很有可能,您的新家居家具网站现在被翻译为“Home-Einrichtung”,这对任何德国人来说听起来都很荒谬。
所以,我的问题归结为:
您知道有任何开源 PHP 项目可以处理类似的事情吗?我基本上是在寻找一个框架,允许您将国际化网站置于“翻译模式”,并使字符串可点击和可翻译,例如通过 Javascript 模式。
我并不是在寻找一个成熟且 可翻译的框架。现成的解决方案,但很想了解我可以为其贡献代码的类似项目。
提前致谢!
Facebook has this unique and clever approach to localization of their site: translators (in their case users that help to translate the site voluntarily) can simply click on the not-yet-translated strings – which are marked with a green bottom border – in their natural context on the site. See http://www.facebook.com/translations/.
Now, if you ever had to deal with the translation of a website, you'll be well aware of how odd and funny some of these translations can be when using tools like poedit where the translator isn't fully aware of the spot the translated string will lated appear in on the website.
Example: Please translate "Home". In German, for instance, the start page of a website would be "Home" while the house you live in is "Heim". Now, you as the translator basically have to guess which context this term is likely to appear in on the website and translate accordingly. Chances are, you're new website on home furniture now translates as "Home-Einrichtung" which sounds ridiculous to any German.
So, my question boils down to:
Do you know any open source PHP projects that work on something like this? I'm basically looking for a framework that allows you to put your internationalized website in "translation mode" and make strings clickable and translatable e.g. through a Javascript modal.
I'm not so much looking for a full-fledged and ready-made solution, but would love to know about similar projects that I can contribute code to.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你想用 jquery & 推出自己的jquery browserLanguage,这可能会让你继续。
使用
class="i18n"
标记所有可翻译文本的包含元素,并包括 jquery、jquery browserLanguage 和您的 i18n 脚本。1。 国际化 javascript
——这需要通过 ajax 从您的服务器接受翻译,例如:
2。 php i18n 翻译服务
—现在我们需要提供翻译并接受它们
数据库将看起来像一堆表格,每种语言一个。
php 将需要一些连接和数据库操作.. 现在可以这样做:
代码很简单:
3。 页面翻译机制
——最后我们可以使用一些进一步的 jquery 将它们在您的网页中结合在一起:
请注意,我没有服务器来测试这个...而且我实际上并不编写 php 代码。 :D 这需要一些调试,但脚手架应该是正确的。
If you want to roll your own with jquery & jquery browserLanguage, this might get you going.
Tag all translatable text's contain elements with
class="i18n"
, and include jquery, jquery browserLanguage, and your i18n script.1. the internationalization javascript
— this needs to accept translations via ajax from your server, like:
2. php i18n translation service
— now we need to serve up translations, and accept them
the database will look like a bunch of tables, one for each language.
the php will need some connection and db manipulation.. for now this may do:
the code is simply:
3. page translation mechanics
— finally we can tie them together in your webpages with some further jquery:
Mind you I don't have a server to test this on... and I don't actually code php. :D It will take some debugging but the scaffolding should be correct.