<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://dev.eiffel.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LinkUpdater</id>
		<title>EiffelStudio: an EiffelSoftware project - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://dev.eiffel.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LinkUpdater"/>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/Special:Contributions/LinkUpdater"/>
		<updated>2026-06-01T23:07:03Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://dev.eiffel.com/index.php?title=Internationalization/locale&amp;diff=11738</id>
		<title>Internationalization/locale</title>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Internationalization/locale&amp;diff=11738"/>
				<updated>2008-11-03T08:12:09Z</updated>
		
		<summary type="html">&lt;p&gt;LinkUpdater: /* References and useful links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Internationalization]]&lt;br /&gt;
&lt;br /&gt;
In computing, locale is a set of parameters that defines the user's language, country and any special variant preferences that the user wants to see in their user interface.&lt;br /&gt;
&lt;br /&gt;
== Format of locale on OS's ==&lt;br /&gt;
* windows: hexadecimal code consisting of a language code (lower 10 bits) and culture code (upper bits), aka Locale Identifier (LCID). Note: the LCID is the same for different variants of language like Norwegian (Bokmal) and Norwegian (Nynorsk) (they use the same locale settings)&lt;br /&gt;
&lt;br /&gt;
* linux, unix: defined as [language[_territory][.codeset][@modifier]]&lt;br /&gt;
&lt;br /&gt;
== Where to find locale ==&lt;br /&gt;
=== Linux ===&lt;br /&gt;
the environment variable is LANG&lt;br /&gt;
&lt;br /&gt;
here is a list for more specific variables:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellspacing=&amp;quot;3&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! '''Locale category'''&lt;br /&gt;
! '''Application'''&lt;br /&gt;
|-&lt;br /&gt;
|LC_COLLATE&lt;br /&gt;
|Collation of strings (sort order.)&lt;br /&gt;
|-&lt;br /&gt;
|LC_CTYPE&lt;br /&gt;
|Classification and conversion of characters.&lt;br /&gt;
|-&lt;br /&gt;
|LC_MESSAGES&lt;br /&gt;
|Translations of yes and no.&lt;br /&gt;
|-&lt;br /&gt;
|LC_MONETARY&lt;br /&gt;
|Format of monetary values.&lt;br /&gt;
|-&lt;br /&gt;
|LC_NUMERIC&lt;br /&gt;
|Format of non-monetary numeric values. &lt;br /&gt;
|-&lt;br /&gt;
|LC_TIME&lt;br /&gt;
|Date and time formats.&lt;br /&gt;
|-&lt;br /&gt;
|LC_ALL&lt;br /&gt;
|Sets all of the above (overrides all of them.)&lt;br /&gt;
|-&lt;br /&gt;
|LANG&lt;br /&gt;
|Sets all the categories, but can be overridden by the individual locale categories.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
The LCID for &amp;quot;Language for non-Unicode programs&amp;quot; (aka system locale) can be found in the windows registry.&amp;lt;br&amp;gt;&lt;br /&gt;
The LCID of &amp;quot;standards and formats&amp;quot; (aka user locale) doesn't seem to be in the registry nor in the environment variables of windows.&lt;br /&gt;
There are some macros defined in windows.h that help getting these values.&lt;br /&gt;
&lt;br /&gt;
== How to access to locale ==&lt;br /&gt;
=== Linux ===&lt;br /&gt;
The function &amp;quot;get&amp;quot; that fetches the language environment variable (LANG) can be found in class EXECUTION_ENVIRONMENT&lt;br /&gt;
&lt;br /&gt;
SHARED_EXEC_ENVIRONMENT: located [https://eiffelsoftware.origo.ethz.ch/svn/es/branches/soft-arch/Src/Eiffel/eiffel/shared/shared_exec_environment.e here]&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
In Eiffel there exist a &amp;quot;locale_id&amp;quot; in class WEL_COMPARE_ITEM_STRUCT that uses the macro MAKELCID to get the locale identifier (aka LCID) from the language id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Two solutions:&amp;lt;br&amp;gt;&lt;br /&gt;
* Get the language id&lt;br /&gt;
* Use the locale id (convenient if SortID is needed)&lt;br /&gt;
in both cases the solution can be found the macros of windows.h&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes:&amp;lt;br&amp;gt;&lt;br /&gt;
Locale id is formed by SortID and LanguageID.&amp;lt;br&amp;gt;&lt;br /&gt;
SortID contains info on the language encoding (?) like japanese unicode order, japanese XJIS order, chinese unicode order, chinese BIG5 order,...&amp;lt;br&amp;gt;&lt;br /&gt;
Macros for windows are contained in &amp;quot;windows.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Needed macro (the one that gets the user LCID): GetUserDefaultLCID()'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[eiffel,N]&lt;br /&gt;
language_id: NATURAL_32 is&lt;br /&gt;
	external&lt;br /&gt;
		&amp;quot;C inline use &amp;lt;windows.h&amp;gt;&amp;quot;&lt;br /&gt;
	alias&lt;br /&gt;
		&amp;quot;return GetUserDefaultLCID();&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OS detection ==&lt;br /&gt;
Queries for OS detection cam be found in class PLATFORM&lt;br /&gt;
&lt;br /&gt;
== References and useful links ==&lt;br /&gt;
* [http://www.unicode.org/cldr/apps/survey CLDR Survey Tool] Contains info about what a locale can refer to (e.g. language codes, time format, ...)&lt;br /&gt;
* [http://www.unicode.org/cldr/ Common Locale Data Repository] main page&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Date_and_time_notation_by_country Date and time notations]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Locale Locale on wikipedia]&lt;/div&gt;</summary>
		<author><name>LinkUpdater</name></author>	</entry>

	</feed>