I'm a new UBUNTU user (version 16.04 LTS). I'm from Brazil and my keyboard is configured as Brazilian Portuguese (ABNT2). I want to change the dot key of numeric keyboard (laptop SAMSUNG NP500R5H-XD2BR). The key is configured for comma... I've tried to follow these steps:

Set LC_NUMERIC to English permanently

$ locale | grep LC_NUMERIC
$ echo 'export LC_NUMERIC="C"' >>~/.bashrc
$ source ~/.bashrc    
$ locale | grep LC_NUMERIC

So that succeeded, but the situation doesn't change... Is there something else I can do?

  • 1
    Your locale is already English (en.US) so will be the same as C locale. Do you want to use Brazilian Portuguese locale?
    – Zanna
    Aug 26 '16 at 21:19
  • Zanna, my first shot to change the numeric format (on the numeric keyboard, comma --> dot) was change for the English locale... it didn't work. After that, i tried the script above and again it didn't work! Aug 29 '16 at 16:39
  • So first your locale was pt_BR and you changed to en.US?
    – Zanna
    Aug 29 '16 at 16:43
  • Yes, because de pt_BR pattern is comma as decimal separator... Actually, i realized the problem is the samsung keyboard design... the same problem occurs in win10 SO... Aug 29 '16 at 20:27
  • I was going to say I think it's your keyboard layout rather than locale - have you played around with that?
    – Zanna
    Aug 29 '16 at 20:29

Try this (as root):

locale-gen pt_BR.UTF-8
echo 'LANG="pt_BR.UTF-8"\nLC_ALL="pt_BR.UTF-8"' > /etc/default/locale

And reboot...

  • LC_ALL should be unset... and /etc/default/locale is generated by update-locale and should only contain LANG and LANGUAGE
    – Zanna
    Aug 26 '16 at 21:23
  • LC_ALL just overrides LC_*. I know update-locale generates /etc/default/locale, but in the end it is just a script with some checking, the overall result is the same. I use this code to initialize my ubuntu docker server images and it works fine.
    – Vinicius
    Aug 26 '16 at 21:35
  • I can't remember exactly why, but just setting LANG & LANGUAGE didn't work for me and I had to set LC_* (and later changed to LC_ALL) in order to work properly. I created this script in a 14.04 server and now I'm using in 16.04 servers.
    – Vinicius
    Aug 26 '16 at 21:39
  • Hmm after generating the locale and updating LANG & LANGUAGE it shouldn't be necessary to set LC_*... I never had that problem. But I guess no harm to set it there : S
    – Zanna
    Aug 26 '16 at 21:51
  • Thanks Vinicius. I'm quite sure the the problem is the samsung's keyboard config... Aug 29 '16 at 20:28

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.