0

I developed a project on a Debian, but now I've installed an Ubuntu server, and the development of our projects moved to this new server.

Debian will be the production server.

When I am using gettext, the locale code on debian is en_US while on ubuntu there is no such code like this, but en_US.utf8.

I have no admin rights on debian, only ftp, and a very restricted ssh, so I can play only with ubuntu server.

I want to unify language codes on all environments, so it should be en_US.

How can I install this to ubuntu, or make an alias from en_US.utf8 -> en_US?

I've tried:

apt-get install language-pack-en language-pack-en-base

it does not helps. I also need to do this for othere languages too, like de_DE.

root@mydev:/usr/share/locales# locale -a
C
C.UTF-8
...
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8 <!-- need en_US only
en_ZA.utf8
...
POSIX
  • Have you tried /etc/locale.alias you should be able to achieve this: en_US en_US.utf8 – George Udosen Feb 15 '17 at 14:02
  • @George no, I am not so familiar to linux. I try it, and tell you what was the result. – vaso123 Feb 15 '17 at 14:09
  • Yes, it seems it works. First it has not worked, I did not understand why, but I thought, I need to restart apache and yes, after that is ok! Thank you, add it as an answer if you want me to accept it. – vaso123 Feb 15 '17 at 14:22
  • Great glad it worked, just added an answer :)... – George Udosen Feb 15 '17 at 15:00
  • Doing so will make en_US enable UTF-8 encoding, which in itself is good on Ubuntu. Since also Debian uses glibc, where en_US normally enables latin1 encoding, it's possible that you will encounter encoding problems. – Gunnar Hjalmarsson Feb 15 '17 at 17:03
0

You can create aliases using the /etc/locale.alias, you should be able to achieve this:

en_US     en_US.utf8

Source:

http://manpages.ubuntu.com/manpages/wily/en/man5/locale.alias.5.html

  • Doing so will make en_US enable UTF-8 encoding, which in itself is good on Ubuntu. Since also Debian uses glibc, where en_US normally enables latin1 encoding, it's possible that the OP will encounter encoding problems. – Gunnar Hjalmarsson Feb 15 '17 at 17:04

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.