php php中gettext的完整示例
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4062832/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
complete example of gettext in php
提问by Sherif Buzz
i've been googling for the last hour or so trying to find a complete working example of gettext in php - all source files, po files, with proper paths, etc. Just a "hello world" with all the required files.
过去一个小时左右,我一直在谷歌搜索,试图在 php 中找到一个完整的 gettext 工作示例——所有源文件、po 文件、正确的路径等。只是一个包含所有必需文件的“hello world”。
I was wondering if anybody has such a working example. thanks in advance.
我想知道是否有人有这样的工作示例。提前致谢。
回答by 2grit
I've read these other guides posted for this question, but none of them was complete enough for me and also they seem to be rushing into the subject.
我已经阅读了针对这个问题发布的这些其他指南,但没有一个对我来说足够完整,而且他们似乎急于进入这个主题。
THIS GUIDEis divided in many parts, you'll learn from a simple Hello World
to a complex plural management. It not just explain what every function does, but also the values used for these functions.
本指南分为许多部分,您将从简单Hello World
到复杂的复数管理学习。它不仅解释了每个函数的作用,还解释了用于这些函数的值。
As a bonus, this guide teaches how to use Poeditwhich is a very helpful toll for working with gettext
internationalization and a must have if you are dealing with a huge project.
作为奖励,本指南教授了如何使用Poedit,这对gettext
国际化工作非常有帮助,如果您正在处理大型项目,则必须拥有。
The OP may change the accepted answer to this one if he also think that guide is better. So this answer can get more attention and more gettext
beginners like me can be helped.
如果 OP 也认为该指南更好,则他可能会更改已接受的答案。所以这个答案可以得到更多的关注,gettext
可以帮助更多像我这样的初学者。
回答by Jabari
There is an outstanding five part tutorial at Sitepoint.com called Localizing PHP Applications “The Right Way”. I highly recommend reviewing all five parts!
Sitepoint.com 上有一个出色的五部分教程,称为“正确的方式”本地化 PHP 应用程序。我强烈建议您查看所有五个部分!