Ubuntu Server下PHP的多语言功能

用了PHP这么久还是头一次用国际(多语言)功能:gettext,原以为参照O’Reilly的gettext教程就可以用上了,发现不行,找了一轮资料才发现要手动配置系统的locale才可以用。

首先修改 /var/lib/locales/supported.d/local 文件

sudo nano /var/lib/locales/supported.d/local

接着使文件生效

sudo dpkg-reconfigure locales

最后重启php-fpm即生效

sudo service php5-fpm restart

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s