Home > Database > Mysql Tutorial > body text

zend framework2使用教程【四】–翻译和样式

WBOY
Release: 2016-06-07 15:39:12
Original
1510 people have browsed it

我们从 git上下载的示例非常好,但是我们需要修改标题并移除版权信息。 默认的应用使用 Zend\I18n ’s的翻译机制来翻译所有文本。它使用位于Application/language目录的.po文件,你需要下载poedit软件来修改文本的内容。打开poedit并打开application/languag

我们从 git上下载的示例非常好,但是我们需要修改标题并移除版权信息。

默认的应用使用 Zend\I18n’s的翻译机制来翻译所有文本。它使用位于Application/language目录的.po文件,你需要下载 poedit软件来修改文本的内容。打开poedit并打开application/language/en_US.po,点击列表中的“Skeleton Application”,并在空白栏里填写“我的zf应用”来对它进行翻译,你可以使用任何你喜欢的语句。翻译完之后,点击工具栏上的保存,poedit会为我们创建一个en_us.mo的文件。如果你发现没有生成.mo文件,一次点击文件-首选项-编辑器,查看“行为”一栏下的“保存时自动编译.mo文件”前的勾勾是否勾上。

要移除版权信息,我们需要编辑Application模块下的layout.phtml视图脚本:

// module/Application/view/layout/layout.phtml:
// Remove this line:

© 2005 - 2012 by Zend Technologies Ltd. translate('All rights reserved.') ?>

Copy after login

现在刷新我们之前建立的首页,看看翻译效果吧。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!