Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] change locale numeric LC_NUMERIC="en_US.UTF-8"

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
maxbre
Posts: 76
Joined: 2014-11-08 16:44

[SOLVED] change locale numeric LC_NUMERIC="en_US.UTF-8"

#1 Post by maxbre »

hi

what follows is my locale settings: how can I change JUST (JUST THAT!) the locale numeric configuration to LC_NUMERIC="en_US.UTF-8"
my aim is to get the dot instead of the comma as decimal separator (all the rest being unaltered)

thanks for the help eventually much appreciated

Code: Select all

max@max-debian:~$ locale
LANG=it_IT.utf8
LANGUAGE=
LC_CTYPE="it_IT.utf8"
LC_NUMERIC="it_IT.utf8"
LC_TIME="it_IT.utf8"
LC_COLLATE="it_IT.utf8"
LC_MONETARY="it_IT.utf8"
LC_MESSAGES="it_IT.utf8"
LC_PAPER="it_IT.utf8"
LC_NAME="it_IT.utf8"
LC_ADDRESS="it_IT.utf8"
LC_TELEPHONE="it_IT.utf8"
LC_MEASUREMENT="it_IT.utf8"
LC_IDENTIFICATION="it_IT.utf8"
LC_ALL=
Last edited by maxbre on 2017-05-29 06:41, edited 3 times in total.

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: change locale numeric setting to LC_NUMERIC="en_US.UTF-8

#2 Post by phenest »

Code: Select all

man locale
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: change locale numeric setting to LC_NUMERIC="en_US.UTF-8

#3 Post by Dai_trying »

man locale wrote:The following example compiles a custom locale from the ./wrk directory with the localedef(1) utility under the $HOME/.locale directory, then tests the
result with the date(1) command, and then sets the environment variables LOCPATH and LANG in the shell profile file so that the custom locale will be used
in the subsequent user sessions:

$ mkdir -p $HOME/.locale
$ I18NPATH=./wrk/ localedef -f UTF-8 -i fi_SE $HOME/.locale/fi_SE.UTF-8
$ LOCPATH=$HOME/.locale LC_ALL=fi_SE.UTF-8 date
$ echo "export LOCPATH=\$HOME/.locale" >> $HOME/.bashrc
$ echo "export LANG=fi_SE.UTF-8" >> $HOME/.bashrc
you can then modify your custom locale settings to suit your needs.

maxbre
Posts: 76
Joined: 2014-11-08 16:44

Re: change locale numeric setting to LC_NUMERIC="en_US.UTF-8

#4 Post by maxbre »

sorry not bit sure to get it completely...

you mean in my specific case something like this would do the trick?

Code: Select all

$ mkdir -p $HOME/.locale
$ I18NPATH=./wrk/ localedef -f UTF-8 -i it_IT $HOME/.locale/it_IT.UTF-8
$ LOCPATH=$HOME/.locale LC_ALL=it_IT.UTF-8 date
$ echo "export LOCPATH=\$HOME/.locale" >> $HOME/.bashrc
$ echo "export LC_NUMERIC=en_US.UTF-8" >> $HOME/.bashrc
and just in case I need to change another locale (e.g. LC_MONETARY) I would do like this

Code: Select all

$ echo "export LC_MONETARY=en_US.UTF-8" >> $HOME/.bashrc
is that right?

thank you

desperate newbe :shock:

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: change locale numeric setting to LC_NUMERIC="en_US.UTF-8

#5 Post by Dai_trying »

Yes that should work.

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: change locale numeric setting to LC_NUMERIC="en_US.UTF-8

#6 Post by phenest »

I'm trying to do the opposite to the OP (language wise) as a test.

Lines added to .bashrc:

Code: Select all

export LOCPATH=$HOME/.locale/
export LC_NUMERIC=it_IT.UTF-8
But, I'm getting this error when I open a terminal:

Code: Select all

bash: warning: setlocale: LC_NUMERIC: cannot change locale (it_IT.UTF-8): No such file or directory
Except, that it does exist, and it did change.

EDIT: Ignore this. I think something else in the .bashrc was interfering. Best to put those lines near the beginning.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

maxbre
Posts: 76
Joined: 2014-11-08 16:44

Re: change locale numeric settingLC_NUMERIC="en_US.UTF-8"

#7 Post by maxbre »

I did exactly like this

Code: Select all

mkdir -p $HOME/.locale
$ I18NPATH=./wrk/ localedef -f UTF-8 -i it_IT $HOME/.locale/it_IT.UTF-8
$ LOCPATH=$HOME/.locale LC_ALL=it_IT.UTF-8 date
$ echo "export LOCPATH=\$HOME/.locale" >> $HOME/.bashrc
$ echo "export LC_NUMERIC=en_US.UTF-8" >> $HOME/.bashrc
and I've got this warning message by the console

Code: Select all

bash: attenzione: setlocale: LC_NUMERIC: impossibile cambiare la localizzazione (en_US.UTF-8): File o directory non esistente

an then if I check my locale settings I got something like this...
to note that LC_NUMERIC is now en_US.UTF-8

Code: Select all

~$ locale
locale: Impossibile impostare LC_ALL alla localizzazione predefinita: File o directory non esistente
LANG=it_IT.UTF-8
LANGUAGE=
LC_CTYPE="it_IT.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=it_IT.utf8
LC_COLLATE="it_IT.UTF-8"
LC_MONETARY=it_IT.utf8
LC_MESSAGES="it_IT.UTF-8"
LC_PAPER=it_IT.utf8
LC_NAME="it_IT.UTF-8"
LC_ADDRESS="it_IT.UTF-8"
LC_TELEPHONE="it_IT.UTF-8"
LC_MEASUREMENT=it_IT.utf8
LC_IDENTIFICATION="it_IT.UTF-8"
LC_ALL=

what does it means?
how to fix it?

thanks

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: change locale numeric settingLC_NUMERIC="en_US.UTF-8"

#8 Post by phenest »

Did you not read my post? It's the post before yours. It shows exactly the same error and shows how I fixed it.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

maxbre
Posts: 76
Joined: 2014-11-08 16:44

Re: change locale numeric settingLC_NUMERIC="en_US.UTF-8"

#9 Post by maxbre »

yes, now I see (understand) what you mean in the very end of your post

so the solution is just to put those lines at the beginning of the file .bashrc, right?

many thanks

maxbre
Posts: 76
Joined: 2014-11-08 16:44

Re: change locale numeric settingLC_NUMERIC="en_US.UTF-8"

#10 Post by maxbre »

apparently the solution to put the following lines

Code: Select all

export LC_NUMERIC=en_US.UTF-8
export LOCPATH=$HOME/.locale
somewhere at the beginning of the file .bashrc does not work for myself

still getting the pretty annoying message when opening the terminal

Code: Select all

    bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
any help for that?

:x :?: :cry:

maxbre
Posts: 76
Joined: 2014-11-08 16:44

Re: change locale numeric settingLC_NUMERIC="en_US.UTF-8"

#11 Post by maxbre »

sorry, now I sorted out the problem by generating the locale setting for en_US.UTF-8 by
"Get root and type dpkg-reconfigure locales and select the locale(s) you want to generate"
see https://wiki.debian.org/Locale

it's time to close this long thread
thanks to all for the support

Post Reply