Difference between revisions of "Talk:Locale"

From ArchWiki
Jump to: navigation, search
(.bashrc)
(Brackets: re)
 
(73 intermediate revisions by 11 users not shown)
Line 1: Line 1:
== .bashrc ==
+
== Create custom locale ==
  
.bashrc is only used by interactive bash sessions, right? So that if you login with KDM in KDE (or GDM gnome), the whole KDE session will inherit the locale set by init->KDM and will not use the one set in .bashrc!
+
:''[Moved from the main article. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 23:15, 24 February 2016 (UTC)]''
  
I guess a "source ~/.bashrc" in ~/.xprofile would solve this.
+
Modified locales will not survive the upgrade of {{pkg|glibc}} because the relevant file is not in the [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/glibc#n19 backup field] in the PKGBUILD. Custom locales should be ''created'' instead. -- [[User:Lahwaacz]] 08:59, 22 December 2014
  
--[[User:Luetti|Luetti]] 17:56, 8 July 2008 (EDT): I don't think so. I tried almost the whole day to set only LC_PAPER="de_DE.utf8". Trying this in almost every file possible (/etc/profile, .xprofile, .bashrc, /etc/rc.local) seemed to work, as I used "locale" in terminal to verify it. But this only worked for applications I started from terminal, but not for applications started from the gnome-menu. So I came to the conclusion it has something to do with gdm. After having a closer look to /etc/gdm/xsession the problem was clear. GDM probably always sets $GDM_LANG on login. When $GDM_LANG is set, xsession will unset all other LC-variables. Just commented out this part and now everything works as desired.
+
<hr>
If this is a common and/or important problem, I will add this to the article. What do you think?
+
=== Customizing locales ===
:I think more information on this is missing in the article. I want to have LC_MESSAGES=C, LANG=de_DE.UTF-8 and LC_TIME=en_DK.UTF-8, but gnome seems to overwrite the settings. When I comment out the lines with GDM_LANG in /etc/gdm/Xsession, I can no longer log in. I would also appreciate it if someone who knows the role of the settings in "Region&Language" in gnome-control-center could add this to the article. Where are they saved and how do I disable them in favor of detailed settings (globally in /etc/locale.conf or locally in ~/.profile)? [[User:Viktordick|Viktordick]] ([[User talk:Viktordick|talk]]) 21:43, 13 April 2013 (UTC)
+
  
== LC_MESSAGES ==
+
Locales are defined in text files located in {{ic|/usr/share/i18n/locales/}} and can be edited to adapt to particular needs.
  
Setting LC_MESSAGES to "C" or "POSIX" (as opposed to "en_US.UTF-8" for example), can save tens of syscalls in a simple program without any loss (since all you need is plain English anyway). It's 29 less syscalls (on my system) for a simple "ls /no/such/dir".  Add this info inside?  --[[User:Philomath|Philomath]] ([[User talk:Philomath|talk]]) 07:55, 2 July 2012 (UTC)
+
After editing a locale file, do not forget to [[#Generating locales|re-generate]] the locales for the changes to take effect after reboot.
  
 +
==== Setting the first day of the week ====
  
== locale.sh ==
+
In many countries the first day of the week is Monday. To adjust this, change or add the following lines:
If setting locale.conf doesn't work (symptom: everything is set to POSIX no matter whats in locale.conf), reinstall filesystem.
+
(locale.sh somehow gets lost, see comment here https://plus.google.com/114015603831160344127/posts/2zKCcnTWDpa happens after the switch to systemd)
+
  
JKAbrams 01 December 2012
+
{{hc|/usr/share/i18n/locales/''chosen_locale''|
 +
LC_TIME
 +
[...]
 +
week            7;19971130;5
 +
first_weekday  2
 +
first_workday  2
 +
}}
  
== locale.conf quotes ==
+
== Login manager missing ==
  
Are the quotes mandatory in locale.conf?
+
This article does not cover the login manager. I have my system in *German*, but my login manager is still using the *English* keyboard layout, and I don't know how to change it. [[Locale]] does not cover it, and I couldn't find anything in [[Display_manager#Set_the_language|Display manager]] neither - albeit there is a comment that it is missing and *should* be linked here.
Im wondering because in the [[Beginners'_Guide#Locale|Beginners'_Guide]] there is no quote.
+
--[[User:Bikepunk|Bikepunk]] ([[User talk:Bikepunk|talk]]) 22:10, 26 December 2012 (UTC)
+
  
:Tested with the LANG attribute, and there seems to be no ill effect either way. [[User:T1nk3r3r|T1nk3r3r]] ([[User talk:T1nk3r3r|talk]]) 21:54, 3 January 2013 (UTC)
+
So How do I change the locale in the display manager?
 +
 
 +
--[[User:Nerdoc|Nerdoc]] ([[User talk:Nerdoc|talk]]) 04:33, 10 March 2016 (UTC)
 +
 
 +
:"The" display manager, there's a few dozen of them. So which do you use? -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 14:37, 10 March 2016 (UTC)
 +
 
 +
== Brackets ==
 +
 
 +
Regarding [https://wiki.archlinux.org/index.php?title=Locale&diff=448117&oldid=448067], this is mentioned in {{man|7|man-pages}}, but I don't see it in [[Help:Reading]] or [[Help:Style/Formatting and punctuation]]. If not present, it could be a good addition, or at least, mention the meaning of the brackets in this article. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 17:54, 26 August 2016 (UTC)
 +
 
 +
:It's not exactly wiki style as covered by [[Help:Reading]], but a de facto standard (sometimes [https://en.wikipedia.org/wiki/Ebnf more than that]). It's needed only rarely so it should be handled case by case. Feel free to explain it on this page. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 18:11, 26 August 2016 (UTC)
 +
 
 +
::[[Help:Style/Formatting and punctuation#Pseudo-variables in file/command line contents]] was designed to be Simple, but of course it can hardly be applied to complex syntaxes. I agree that in these cases we should rely on the upstream syntax and possibly explain what may not be immediately clear for readers. [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:44, 27 August 2016 (UTC)

Latest revision as of 03:44, 27 August 2016

Create custom locale

[Moved from the main article. -- Alad (talk) 23:15, 24 February 2016 (UTC)]

Modified locales will not survive the upgrade of glibc because the relevant file is not in the backup field in the PKGBUILD. Custom locales should be created instead. -- User:Lahwaacz 08:59, 22 December 2014


Customizing locales

Locales are defined in text files located in /usr/share/i18n/locales/ and can be edited to adapt to particular needs.

After editing a locale file, do not forget to re-generate the locales for the changes to take effect after reboot.

Setting the first day of the week

In many countries the first day of the week is Monday. To adjust this, change or add the following lines:

/usr/share/i18n/locales/chosen_locale
LC_TIME
[...]
week            7;19971130;5
first_weekday   2
first_workday   2

Login manager missing

This article does not cover the login manager. I have my system in *German*, but my login manager is still using the *English* keyboard layout, and I don't know how to change it. Locale does not cover it, and I couldn't find anything in Display manager neither - albeit there is a comment that it is missing and *should* be linked here.

So How do I change the locale in the display manager?

--Nerdoc (talk) 04:33, 10 March 2016 (UTC)

"The" display manager, there's a few dozen of them. So which do you use? -- Alad (talk) 14:37, 10 March 2016 (UTC)

Brackets

Regarding [1], this is mentioned in man-pages(7), but I don't see it in Help:Reading or Help:Style/Formatting and punctuation. If not present, it could be a good addition, or at least, mention the meaning of the brackets in this article. -- Alad (talk) 17:54, 26 August 2016 (UTC)

It's not exactly wiki style as covered by Help:Reading, but a de facto standard (sometimes more than that). It's needed only rarely so it should be handled case by case. Feel free to explain it on this page. -- Lahwaacz (talk) 18:11, 26 August 2016 (UTC)
Help:Style/Formatting and punctuation#Pseudo-variables in file/command line contents was designed to be Simple, but of course it can hardly be applied to complex syntaxes. I agree that in these cases we should rely on the upstream syntax and possibly explain what may not be immediately clear for readers. – Kynikos (talk) 03:44, 27 August 2016 (UTC)