Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] gedit change the default language
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
percy_vere_uk
Apprentice
Apprentice


Joined: 13 Dec 2008
Posts: 210
Location: Dorset UK

PostPosted: Sat Dec 07, 2013 1:29 pm    Post subject: [solved] gedit change the default language Reply with quote

Hi

How do I change the default language in gedit from English (United States) to English (United Kingdom).

percy


Last edited by percy_vere_uk on Fri Dec 13, 2013 2:04 pm; edited 3 times in total
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Sat Dec 07, 2013 2:20 pm    Post subject: Reply with quote

Update a shortcut with LC_ALL=target_language gedit
Back to top
View user's profile Send private message
percy_vere_uk
Apprentice
Apprentice


Joined: 13 Dec 2008
Posts: 210
Location: Dorset UK

PostPosted: Mon Dec 09, 2013 12:43 pm    Post subject: Reply with quote

krinn

Code:
# LC_ALL=en_GB.utf8 gedit


Works as root but not as an ordinary user.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Mon Dec 09, 2013 1:01 pm    Post subject: Reply with quote

Well, i'm not sure what you are speaking about
Code:
LC_ALL=C gedit

And i get english version

Code:
LC_ALL=fr_FR gedit
>(process:22191): Gtk-WARNING **: Locale not supported by C library.
>   Using the fallback 'C' locale.

Again, english version, but there's no magic, gtk told me why : locale not supported, so back to C locale

Code:
grep fr_FR /etc/locale.gen
>fr_FR.UTF-8 UTF-8
>#fr_FR ISO-8859-1
>#fr_FR@euro ISO-8859-15
LC_ALL=fr_FR.UTF8 gedit
And i get french version

So, you mistake utf8 with UTF-8 or don't have support for en_GB.UTF8 : one or the other, but you should have get the error message from gtk too.
Back to top
View user's profile Send private message
percy_vere_uk
Apprentice
Apprentice


Joined: 13 Dec 2008
Posts: 210
Location: Dorset UK

PostPosted: Tue Dec 10, 2013 1:45 pm    Post subject: Reply with quote

Thanks krinn

Code:
# LC_ALL=en_GB gedit


In root terminal this works and gives english (united kingdom) as required.

Code:
$ LC_ALL=en_GB gedit


In terminal as an ordinary user no messages from gtk and gives english (united states).

The same applies using
Code:
LC_ALL=en_GB.utf8 gedit
as root and as an ordinary user.

So this works fine as root but not as an ordinary user.

Can I set
Code:
LC_ALL=en_GB gedit
to apply to all users when booting the system. If so how?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Tue Dec 10, 2013 2:08 pm    Post subject: Reply with quote

No real idea, i didn't think there would be any rules to control the state of localization for a user.
All i could says is that the commands i gave were done with my user and not as root.

You should reread UTF8 guide, or maybe your gnome have a problem.
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Tue Dec 10, 2013 3:13 pm    Post subject: Reply with quote

percy_vere_uk wrote:

So this works fine as root but not as an ordinary user.

This is very strange, can you post the result of
Code:
$ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.utf8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.utf8"
LC_PAPER=en_US.UTF-8
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Also it might be useful if you have systemd to post your results for:
Code:
$ localectl list-locales
en_US.utf8
es_AR.utf8
pt_BR.utf8

and if you're on openrc for
Code:
$ eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   en_US.utf8 *
  [3]   es_AR.utf8
  [4]   POSIX
  [5]   pt_BR.utf8
  [ ]   (free form)

And also could you try with
Code:
$ LANG=en_GB.utf8 gedit

to see if that works?
percy_vere_uk wrote:

Can I set
Code:
LC_ALL=en_GB gedit
to apply to all users when booting the system. If so how?

What you want to read is the localization guide
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Tue Dec 10, 2013 3:20 pm    Post subject: Reply with quote

also check
Code:
$echo $LANGUAGE

to check if you don't have en_US since some programs (presumably gedit) allow you to specify both LANG and LANGUAGE. LC_ALL should override LANG but I'm no sure (don't think it does) LANGUAGE.
Back to top
View user's profile Send private message
percy_vere_uk
Apprentice
Apprentice


Joined: 13 Dec 2008
Posts: 210
Location: Dorset UK

PostPosted: Wed Dec 11, 2013 2:33 pm    Post subject: Reply with quote

Code:
$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=



I do not have systemd installed


Code:
$ eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   POSIX
  [3]   en_GB
  [4]   en_GB.iso88591
  [5]   en_GB.utf8
  [ ]   (free form)



Code:
$ LANG=en_GB.utf8 gedit    gives english (united states)




Code:
$ echo $LANGUAGE]   returns nothing
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Wed Dec 11, 2013 2:55 pm    Post subject: Reply with quote

this beats me too...
just to be clear, if you do
Code:
$eselect locale set 5

or any of the other GB ones gedit works fine?

I have no clue what could be affecting setting locales for usual users and not for root... I'd start playing with things like
Code:
$ LC_ALL=es_AR date
Wed Dec 11 15:45:50 CET 2013
$ LC_ALL=es_AR.utf8 date
mié dic 11 15:45:55 CET 2013

To get rid of problems that might happen before loading gedit.


Finally LC_ALL superseeds all LC_*** but not LANGUAGE which anyways is not set in your system so this should not work, but just for the sake of it you may wanna try
Code:
$ LANGUAGE=en_GB.utf8 LC_ALL=en_GB.utf8 gedit
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Wed Dec 11, 2013 3:40 pm    Post subject: Reply with quote

Code:
echo $LANGUAGE
>
LC_ALL=C date
> Wed Dec 11 16:07:29 CET 2013
LC_ALL=fr_FR-UTF8 date
Wed Dec 11 16:07:36 CET 2013
LC_ALL=fr_FR date
> Wed Dec 11 16:08:17 CET 2013
date
> mer. déc. 11 16:08:46 CET 2013
LC_ALL=fr_FR.utf8 date
> mer. déc. 11 16:10:29 CET 2013
LANGUAGE=C LC_ALL=fr_FR.utf8 date
> mer. déc. 11 16:11:05 CET 2013
echo $LANG
> fr_FR.UTF-8
LANG=C date
> Wed Dec 11 16:18:58 CET 2013
LANG=fr_FR.UTF-8 date
> mer. déc. 11 16:19:10 CET 2013


I'm not sure where you find that "LANGUAGE" variable, i don't have it, and the localization doesn't speak about it too : https://wiki.gentoo.org/wiki/Localization/HOWTO

And if you had follow the gentoo doc for UTF8 you should had (ahah, both of you) something return by :
Code:
eselect locale list | grep UTF-8
  [4]   fr_FR.UTF-8 *


So reread it, as you have fail at following it or didn't follow it : https://wiki.gentoo.org/wiki/UTF-8/en#Character_Encodings
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Wed Dec 11, 2013 3:49 pm    Post subject: Reply with quote

krinn wrote:
[code]echo $LANGUAGE

I'm not sure where you find that "LANGUAGE" variable, i don't have it, and the localization doesn't speak about it too : https://wiki.gentoo.org/wiki/Localization/HOWTO

And if you had follow the gentoo doc for UTF8 you should had (ahah, both of you) something return by :
[code]eselect locale list | grep UTF-8
[4] fr_FR.UTF-8 *
[/code]

So reread it, as you have fail at following it or didn't follow it : https://wiki.gentoo.org/wiki/UTF-8/en#Character_Encodings

http://www.gnu.org/software/gettext/manual/html_node/Locale-Environment-Variables.html#Locale-Environment-Variables
And I didn't understand the comment on eselect, from the OPs return on eselect he has a locale en_GB.utf8 which he has tried already running "$LC_ALL=en_GB.utf8 gedit"without success... I don't understand why.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Wed Dec 11, 2013 5:09 pm    Post subject: Reply with quote

if i get it right LANGUAGE is to hint what language should be pick by programs if your language doesn't exist.
So a user speaking french and spanish would set LANGUAGE="spanishcode" to avoid program picking up english if french doesn't exist.

potuz wrote:
And I didn't understand the comment on eselect, from the OPs return on eselect he has a locale en_GB.utf8

That's a problem, as his output will return nothing if he grep UTF-8 (and you too, that's why i said "both of you")
While if anyone has follow the documentation like it should : result should be en_GB.UTF-8

I don't know how UTF8 works, but not following the doc may put yourself in trouble, except if you know .uft8 is ok
As a "non real" example: if anyone check a language is utf8 by "xxxx".UTF-8 presence, that check will fail for "xxxx".utf8
Having the .utf8 file may not just be enough, the .UTF-8 file might be the key.
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Wed Dec 11, 2013 6:50 pm    Post subject: Reply with quote

krinn wrote:
if i get it right LANGUAGE is to hint what language should be pick by programs if your language doesn't exist.
So a user speaking french and spanish would set LANGUAGE="spanishcode" to avoid program picking up english if french doesn't exist.

potuz wrote:
And I didn't understand the comment on eselect, from the OPs return on eselect he has a locale en_GB.utf8

That's a problem, as his output will return nothing if he grep UTF-8 (and you too, that's why i said "both of you")
While if anyone has follow the documentation like it should : result should be en_GB.UTF-8

I don't know how UTF8 works, but not following the doc may put yourself in trouble, except if you know .uft8 is ok
As a "non real" example: if anyone check a language is utf8 by "xxxx".UTF-8 presence, that check will fail for "xxxx".utf8
Having the .utf8 file may not just be enough, the .UTF-8 file might be the key.

Well, I've always set my locales as .utf8 (coming from the LFS time) and never had the OP's problem so I suppose that's not the real issue.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Wed Dec 11, 2013 10:37 pm    Post subject: Reply with quote

potuz wrote:
Well, I've always set my locales as .utf8 (coming from the LFS time) and never had the OP's problem so I suppose that's not the real issue.

Looking at that post, it seems you have forget you had do something more than just setting .utf8 : https://forums.gentoo.org/viewtopic-p-7458600.html#7458600
Code:
LC_TIME=en_US.UTF-8


So your "supposition it's not the real issue" might be true, your supposition is base on your experience, but it looks like your experience is backup by a memory that is as good as mine :)
But even we remove any doubt and just assume you are right and it's not the issue there : what would be "bad" for him to follow the UTF8 doc and apply it ?

percy_vere_uk : i'm afraid you will really need help from someone who knows the answer
What i could add to help you is that doing "LC_ALL=C gedit" won't gave me an english gedit if i have one already running in french on another desk, it does open a new gedit, but in french. Could be good then to check no gedit was open while testing.
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Thu Dec 12, 2013 12:36 pm    Post subject: Reply with quote

Code:
$ cat /etc/locale.gen
en_US.UTF-8 UTF-8
pt_BR.UTF-8 UTF-8
es_AR.UTF-8 UTF-8


Code:
$ sudo locale-gen
 * Generating 3 locales (this might take a while) with 1 jobs
 *  (1/3) Generating en_US.UTF-8 ... [ ok ]
 *  (2/3) Generating pt_BR.UTF-8 ... [ ok ]
 *  (3/3) Generating es_AR.UTF-8 ... [ ok ]
 * Generation complete
$ locale -a
C
en_US.utf8
es_AR.utf8
POSIX
pt_BR.utf8

And finally (I chose LC_PAPER cause the output is shorter, but this works for any locale type)
Code:
$ LC_PAPER=en_US.UTF-8 locale -k LC_PAPER
height=279
width=216
paper-codeset="UTF-8"
$ LC_PAPER=en_US.utf8 locale -k LC_PAPER
height=279
width=216
paper-codeset="UTF-8"

This was discussed in This thread
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Thu Dec 12, 2013 1:01 pm    Post subject: Reply with quote

You're picky :)
Code:
locale -a
C
POSIX
fr_FR.utf8


Your thread show at least Sylpheed has made the same symtoms the ones he gets with gedit
Quote:
The difference in the spelling of the codeset breaks Sylpheed (#450063)
which only looks for codeset "UTF-8".

So, even Sylpheed is broken and doesn't follow UTF8 strict rules (rules i again, have no idea what they could be, so i'll assume Sylpheed is broken). It doesn't look crazy to assume gedit do as Sylpheed.
Back to top
View user's profile Send private message
percy_vere_uk
Apprentice
Apprentice


Joined: 13 Dec 2008
Posts: 210
Location: Dorset UK

PostPosted: Thu Dec 12, 2013 1:03 pm    Post subject: Reply with quote

krinn

Yes, while I was testing these various pieces of code I was pasting them into another workspace which was open with gedit.
So going back to the original code:

Code:
$ LC_ALL=en_GB.utf8 gedit


now gives me english (united kingdom)

So thank's to yourself and potuz all is fine now.

percy
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Thu Dec 12, 2013 1:05 pm    Post subject: Reply with quote

percy_vere_uk wrote:
krinn

Yes, while I was testing these various pieces of code I was pasting them into another workspace which was open with gedit.
So going back to the original code:

Code:
$ LC_ALL=en_GB.utf8 gedit


now gives me english (united kingdom)

So thank's to yourself and potuz all is fine now.

percy

hahahahaha! I was going like crazy thinking what the $@#$ could be wrong with your locale settings :)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Thu Dec 12, 2013 1:09 pm    Post subject: Reply with quote

That thread should be elect as candidate for "swimming in mud" thread.
Lot of pain to end with an easy solve :)
Back to top
View user's profile Send private message
percy_vere_uk
Apprentice
Apprentice


Joined: 13 Dec 2008
Posts: 210
Location: Dorset UK

PostPosted: Thu Dec 12, 2013 2:25 pm    Post subject: Reply with quote

I actually jumped the gun, in fact not quite solved .

The code works fine, I have created a test file from a shortcut using
Code:
LC_ALL=en_GB.utf8 gedit
then saved it in english (united kingdom) but when the document is re-opened (with no other instances of gedit open) it reverts back to english (united states) .

I still need to be able to set gedit to english (united kingdom) as a default.

Help once again please.

percy
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Thu Dec 12, 2013 3:30 pm    Post subject: Reply with quote

percy_vere_uk wrote:
I actually jumped the gun, in fact not quite solved .

The code works fine, I have created a test file from a shortcut using
Code:
LC_ALL=en_GB.utf8 gedit
then saved it in english (united kingdom) but when the document is re-opened (with no other instances of gedit open) it reverts back to english (united states) .

I still need to be able to set gedit to english (united kingdom) as a default.

Help once again please.

percy

How are you reopening the file? with the above said shortcut or say by double clicking and having gedit to be the default application. If the latter, then you need to correct the way gnome (or whatever DE you're using) calls gedit to call your shortcut instead of gedit.
Back to top
View user's profile Send private message
percy_vere_uk
Apprentice
Apprentice


Joined: 13 Dec 2008
Posts: 210
Location: Dorset UK

PostPosted: Fri Dec 13, 2013 2:04 pm    Post subject: Reply with quote

potuz

I have been opening gedit files from a file manager (an old habit of many years) I shall from now on use the gedit shortcut which is far more logical. Thank you for coming back to me on this I should have realized this myself.

percy
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Fri Dec 13, 2013 3:21 pm    Post subject: Reply with quote

percy_vere_uk wrote:
potuz

I have been opening gedit files from a file manager (an old habit of many years) I shall from now on use the gedit shortcut which is far more logical. Thank you for coming back to me on this I should have realized this myself.

percy

you can tell your file manager to use that shortcut instead of directly gedit as well.
Back to top
View user's profile Send private message
percy_vere_uk
Apprentice
Apprentice


Joined: 13 Dec 2008
Posts: 210
Location: Dorset UK

PostPosted: Sat Dec 14, 2013 12:54 pm    Post subject: Reply with quote

potuz: Wrote
Quote:

you can tell your file manager to use that shortcut instead of directly gedit as well.


Thanks for that 'you are a star'
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum