[PC-BSD Dev] pcbsd, pcdm locale and language settings

Ken Moore ken at pcbsd.org
Mon Dec 2 11:54:04 PST 2013

PCDM is (currently) just setting the "LANG" and "LC_ALL" environment 
variables appropriately before starting up the selected DE. It is 
possible that the DE itself is loading the /etc/profile or 
/etc/login.conf (which PCDM just ignores at the moment), overwriting the 
variables that PCDM setup for you. I am testing with Fluxbox here (which 
is rather minimalist and does not have much if any localization for the 
UI), and the environment variables are being set properly by PCDM. So it 
might be something specific to the "big" DE's that is causing the issue.

It is sounding more and more that I am going to have to make PCDM modify 
the system files (/etc/profile,  /etc/login.conf, ~/.profile) whenever 
the user changes the localization. I am going to get this setup here 
soon for you and see if that makes any difference.

On 11/28/13 19:55, Joe Maloney wrote:
> So I changed my shell to /bin/sh in root an manually started PCDM 
> after setting LANG=.  At this point PCDM still showed up in english 
> but when I logged into window managers such as mate they all came up 
> in french.  I can see that PCDM was running prior to this as root in 
> /bin/sh so I can’t see why it isn’t picking up /etc/profile and why 
> that variable has to be passed interactively.  In addition just 
> setting LC_ALL= in open box and launching mate-session also works. 
>  Hope that provides a little more insight.  I will continue looking at 
> the PCDM code a little more closely over the next couple of days if I 
> get some more free time.
> Joe Maloney
> On Nov 28, 2013, at 6:02 PM, Joe Maloney <jpm820 at gmail.com 
> <mailto:jpm820 at gmail.com>> wrote:
>> I’ve tested with the new iso released last night.  Language switching 
>> it still broken.  It does switch the language at the PCDM menu but 
>> when you go to log in everything is still in english.
>> I’ve done some more testing today with /etc/profile.  In fact I found 
>> that for gdm3 I had to set /etc/profile to the language I wanted or 
>> GDM would show up in english.  I was able to get command line 
>> applications such as nano to show up in other languages as well by 
>> modifying /etc/login.conf.  Setting up both of these files 
>> unfortunately had no effect on PCDM.
>> From what I was reading login.conf is the preferred systemwide method 
>> on FreeBSD.  Use of profile is actually not recommend because it is 
>> specific to certain shells.  Interestingly enough however GDM3 
>> language switching does not work without setting /etc/profile.
>> I’m unfortunatley not very fluent in qt4 yet so it’s a little tough 
>> for me to see what pcdm is actually trying to do when loading a 
>> window manager.  From what I can tell however it looks like maybe 
>> this pcdmxprocess is just setting an environment variable when 
>> launching the selected window manager?  Is it possible that maybe 
>> whatever shell it is launching with is not loading that variable?  Or 
>> is it maybe something that defining what shell to load that variable 
>> in might fix?  I’m also wondering if there is a way I can pass a 
>> command that pcdm would use for launching a windows manager manually 
>> using say xinit for testing?
>> Joe Maloney
>> On Nov 18, 2013, at 8:18 AM, Ken Moore <ken at pcbsd.org 
>> <mailto:ken at pcbsd.org>> wrote:
>>> On 11/17/13 15:32, Joe Maloney wrote:
>>>> I’ve been working off and on with a user who is french who has been 
>>>> testing my gnome3 packages for some time.  I was able in the past 
>>>> to resolve his language settings not sticking with gdm3 by having 
>>>> the freebsd gnome team patch accountsservice which you guys will 
>>>> probably necessarily need to use i wouldn’t think as it’s more of a 
>>>> gdm3 specific requirement.  However I was trying to look into how I 
>>>> could solve this for a couple of reasons.  I find this to be a very 
>>>> interesting problem.  The second reason would be so that nothing 
>>>> holds back PCDM from going into 10 for sure if I can be of any 
>>>> help.  :)
>>>> I was chatting with the freebsd gnome team today about how gdm2 
>>>> might set locales etc or possible workarounds which I also read 
>>>> about in the FreeBSD handbook.  One was modifying /etc/profile 
>>>> systemwide and ~/profile for each user.  These solutions work for 
>>>> both gdm2, and gdm3.  Here are some examples I was given that also 
>>>> worked for me.
>>>> /etc/profile http://pastebin.com/VYVwymzm
>>>> ~/.profile http://pastebin.com/TG2wZeNJ
>>>> With these enabled gdm2 will also select that language shown in the 
>>>> profile as the default.  After logging into xfce it respects the 
>>>> change as well.  So that would be one way.  However if I start xfce 
>>>> through PCDM it does not respect the change.  Runnning xfce 
>>>> standalone does also not respect the change.  Which leads me to 
>>>> believe gdm is also applying a change in some other file or just on 
>>>> the fly to desktops such as xfce.  So I do think the answer might 
>>>> be finding out how gdm 2 is doing it.  However I’m guessing it must 
>>>> be done on the fly as switching from GDM back to PCDM everything 
>>>> goes back to english regardless of what I set profile and .profile 
>>>> to contain.
>>>> I can see after further research that the problem is obviously much 
>>>> bigger than PCBSD.  Going to the FreeBSD website and selecting 
>>>> french works ok.  But the minute I click download I get an english 
>>>> page, and an iso that starts installing in english with no clear 
>>>> way that I can see to set the language at the beginning of the 
>>>> install.  So I would say that PCBSD is ahead in this regard as the 
>>>> install process can be viewed in many languages.  Truthfully I 
>>>> never realized much of this until now.
>>>> However I’ve been looking further and I can see that there are ways 
>>>> to set locale settings in even places such as rc.conf to control 
>>>> console behavior.  So perhaps if there  were man pages for every 
>>>> language in the base an installer could be written for freebsd as 
>>>> well to automate all of that stuff and just have it available right 
>>>> from the console as well.  So if a user were to type man ping it 
>>>> would display in that language etc out of box.
>>>> I will write in more if I can find a fix for PCDM.  I just wanted 
>>>> to relay some of this conversation I had with freebsd gnome earlier 
>>>> in case any of it would provide any insight into fixing the problem.
>>>> Joe Maloney
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev at lists.pcbsd.org
>>>> http://lists.pcbsd.org/mailman/listinfo/dev
>>> Thanks for the info!
>>> I looked through the "profile" files that you linked to and it looks 
>>> like the only difference is the "LC_ALL" environment variable. PCDM 
>>> already formats/sets the LANG environment variable (default: 
>>> en_US.UTF-8), but we did find/fix some localization bugs in the 
>>> source within the last couple weeks, so perhaps that will fix the 
>>> issues for you. I also just added the LC_ALL environment variable to 
>>> PCDM a moment ago[1], so between these changes PCDM should be 
>>> matching exactly what you reported that GDM was doing.
>>> The only difference is that I do not have PCDM running the 
>>> "~/.profile" file when starting up a user session at the moment. 
>>> This is because of the concern that setting the locale in the login 
>>> manager will not get propagated to the user session appropriately if 
>>> there is a "default" profile setup for users on the system. I think 
>>> the ".profile" file is important if you are doing a remote/CLI login 
>>> on the system, so perhaps I should setup PCDM to auto-modify the 
>>> LANG/LC_ALL variables in that user's file when you login. My only 
>>> concern with this is that I will be modifying a user-preference file 
>>> (which I am very hesitant to do - since I would hate to ruin 
>>> someone's specially configured files).
>>> [1] 
>>> https://github.com/pcbsd/pcbsd/commit/269e8eea83bda065804e5f86353be1d62726e638
>>> -- 
>>> ~~ Ken Moore ~~
>>> PC-BSD/iXsystems
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at lists.pcbsd.org <mailto:Dev at lists.pcbsd.org>
>>> http://lists.pcbsd.org/mailman/listinfo/dev

~~ Ken Moore ~~

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pcbsd.org/pipermail/dev/attachments/20131202/9d01a230/attachment.html>

More information about the Dev mailing list