WordPress本地化、翻译

发布于:
Script

WordPress本地化,要用到的软件,PoEdit,它是一款.po(Portable Object)文件编辑器,,PoEdit常用来汉化各种程序,它内置于wxWidgets工具中,可以在所有它支持的平台上运行,如Unix下的GTK+以及Windows。PoEdit提供更方便的办法编辑目录,而不用通过启动VI文本编辑器,手动编辑。PoEdit是跨平台的开源软件,支持多国语言。

可悲的是:我今天访问他的官网(http://poedit.net/)好像被伟大的GD墙掉了。。

使用 poedit 翻译主题,必须有一个条件,即主题有语言包,可以在主题中看到:languages目录(比如:/public_html/wp-content/themes/twentyfourteen/languages/),然而有些邪教主题会放在lang目录,不过无所谓了,就一个名字而已,load_theme_textdomain 时指定他的目录。

如果要让主题支持语言包,那么你需要在你主题的 functions.php 文件添加下面的代码:

Orchard Date and time culture formatting in po(时间格式化)

发布于:
Orchard CMS

localization files are missing the format used to display published date.

default Parts.Common.Metadata.cshtml declares this :

<div class=”published”>@Display.PublishedState(createdDateTimeUtc: Model.ContentPart.CreatedUtc, publisheddateTimeUtc: Model.ContentPart.PublishedUtc)</div>

And PublishedState shape is declared as follows (in CoreCommonShape.cs) :

return Display.DateTime(DateTimeUtc: createdDateTimeUtc);

And, finally, DateTimeShape.DateTime is :