PHP 本地化问题
我正在构建一个开源产品,并且正在考虑本地化,我已经阅读了 gettext< /a> 但要让它在不同的系统(服务器、操作系统等)中工作似乎有很多问题。
你会如何处理这个问题?有没有一种安全的方法来帮助 gettext 在多个系统上工作?也许已经是了?
来自瑞典的问候/托比亚斯
I'm building a Open Source product and I thinking about Localization, I've read about gettext but there seems to be a lot of problem to get it to work in different systems (servers,os etc).
How would you handle this? Is there a secure way to help gettext work on several systems? Perhaps it already is?
Regards from Sweden / Tobias
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我建议您查看 Zend_translate< /a>, Zend_locale和 Zend_Date。我自己才刚刚开始涉足它们,但对我来说,它们看起来已经是一个非常好的、干净的、现代的国际化解决方案,与 gettext 的混乱形成鲜明对比。
Zend_translate 的介绍列出了许多强有力的论据,说明为什么选择它(或类似的东西)而不是 gettext。
I recommend you take a look at Zend_translate, Zend_locale and Zend_Date. I'm only starting to dabble with them myself, but to me, they already look like a really good, clean and modern solution to internationalization, in contrast to the chaos that is gettext.
The introduction to Zend_translate lists a number of strong arguments why to choose it (or something similar) over gettext.
Zend Framework 的 Zend_Translate 是我所见过的最灵活的。它不一定需要 PHP 端的 gettext 支持模块,因为它本身读取 .mo-binary 格式。
Zend Framework's Zend_Translate is most flexible what I've seen. It doesn't necessarily need gettext support module in PHP's side as it reads the .mo-binary format itself.
语言块应保留在程序外部。它们可能位于数据库或 XML 文件中。这将使以后能够添加更多语言。
然后,您的应用程序需要做的就是识别用户的本地化并为每种情况提供适当的文本。
The language blocks should be kept external to the program. They may be in a database or in XML files. This will enable further languages to be added at a later point in time.
Then all your application needs to do is identify the localisation by the user and serve up the appropriate text for each situation.