问题
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