adding locale on server

假如想象 提交于 2019-12-20 10:28:02

问题


I am planning to use strftime(), however when I check my server regarding what's available locale, via (locale -a), I only have this:

C
en_US.utf8 
POSIX

I badly need to have this de_DE.utf8, in order to turn my dates to German. How can I add additional locale? Is there any other better way?


回答1:


You need to generate de_DE.utf8 locale in your server.

The process is pretty straightforward. For example on Debian/Ubuntu distros, you can add/remove locales by issuing the following command:

sudo dpkg-reconfigure locales

You will be then presented with a list of available locales (basically all of them). Check/uncheck the one you like and click on OK. Good luck!




回答2:


dpkg-reconfigure locales does nothing for me on a plain vanilla install of Ubuntu 12.04 LTS, but locale-gen works like a charm:

sudo locale-gen de_DE.utf8


来源:https://stackoverflow.com/questions/9325024/adding-locale-on-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!