1 Index: sal/util/sal.map
2 ===================================================================
3 RCS file: /cvs/porting/sal/util/sal.map,v
4 retrieving revision 1.42
5 diff -u -p -u -r1.42 sal.map
6 --- sal/util/sal.map 4 Apr 2003 10:46:19 -0000 1.42
7 +++ sal/util/sal.map 14 Oct 2003 16:43:46 -0000
8 @@ -86,6 +86,7 @@ UDK_3_0_0 {
12 + osl_getSystemLocale;
13 osl_getSystemPathFromFileURL;
15 osl_getThreadIdentifier;
16 Index: sal/inc/rtl/locale.h
17 ===================================================================
18 RCS file: /cvs/porting/sal/inc/rtl/locale.h,v
19 retrieving revision 1.3
20 diff -u -p -u -r1.3 locale.h
21 --- sal/inc/rtl/locale.h 26 Apr 2001 13:34:01 -0000 1.3
22 +++ sal/inc/rtl/locale.h 14 Oct 2003 16:43:58 -0000
23 @@ -130,6 +130,15 @@ rtl_Locale * SAL_CALL rtl_locale_registe
24 rtl_Locale * SAL_CALL rtl_locale_getDefault();
27 + As above - but actually useful - and not strangely deprecated,
31 + rtl_LocaleSystemMessages,
32 + rtl_LocaleSystemCType
33 +} rtl_LocaleSystemType;
37 Normally set once at the beginning of applet or application,
38 then never reset. <code>setDefault</code> does not reset the host locale.
39 Index: sal/inc/rtl/locale.hxx
40 ===================================================================
41 RCS file: /cvs/porting/sal/inc/rtl/locale.hxx,v
42 retrieving revision 1.3
43 diff -u -p -u -r1.3 locale.hxx
44 --- sal/inc/rtl/locale.hxx 26 Apr 2001 13:34:01 -0000 1.3
45 +++ sal/inc/rtl/locale.hxx 14 Oct 2003 16:43:58 -0000
46 @@ -263,6 +263,16 @@ public:
48 OUString getVariant() const { return pData->Variant; }
51 + Getter for lang-country name
53 + inline OUString getRawName()
55 + rtl::OUString aRaw = ( getLanguage() +
56 + rtl::OUString::createFromAscii( "-" ) +
62 Returns the hash code of the locale This.
63 Index: sal/inc/osl/process.h
64 ===================================================================
65 RCS file: /cvs/porting/sal/inc/osl/process.h,v
66 retrieving revision 1.14
67 diff -u -p -u -r1.14 process.h
68 --- sal/inc/osl/process.h 26 Mar 2003 16:45:37 -0000 1.14
69 +++ sal/inc/osl/process.h 14 Oct 2003 16:44:16 -0000
70 @@ -360,6 +360,8 @@ oslProcessError SAL_CALL osl_getProcessL
73 oslProcessError SAL_CALL osl_setProcessLocale( rtl_Locale * pLocale );
75 +rtl_Locale * SAL_CALL osl_getSystemLocale( rtl_LocaleSystemType nType );
78 sal_Bool SAL_CALL osl_sendResourcePipe(oslPipe Pipe, oslSocket Socket);
79 Index: sal/osl/unx/nlsupport.c
80 ===================================================================
81 RCS file: /cvs/porting/sal/osl/unx/nlsupport.c,v
82 retrieving revision 1.21
83 diff -u -p -u -r1.21 nlsupport.c
84 --- sal/osl/unx/nlsupport.c 16 Jul 2003 17:21:12 -0000 1.21
85 +++ sal/osl/unx/nlsupport.c 14 Oct 2003 16:44:29 -0000
86 @@ -1347,3 +1347,46 @@ int _imp_setProcessLocale( rtl_Locale *
87 #endif /* ifdef LINUX || SOLARIS || MACOSX || NETBSD */
91 +// Get locale of category LC_CTYPE of environment variables
92 +static sal_Char* GetLangFromEnvironment()
94 + static sal_Char* pFallback = "C";
95 + sal_Char *pLang = NULL;
97 + pLang = getenv ( "LC_ALL" );
99 + pLang = getenv ( "LC_CTYPE" );
101 + pLang = getenv( "LANG" );
108 +rtl_Locale * SAL_CALL osl_getSystemLocale( rtl_LocaleSystemType nType )
110 + const char *pMessages[] = { "LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG", NULL };
111 + const char *pCType[] = { "LC_ALL", "LC_CTYPE", NULL };
112 + const char **pScan;
113 + const char *pLang = NULL;
114 + static rtl_Locale *pLocales[2] = { NULL, NULL };
116 + if( !pLocales[ nType ] )
118 + pScan = (nType == rtl_LocaleSystemMessages) ? pMessages : pCType;
121 + if( pLang = getenv( *pScan ) )
128 + pLocales[ nType ] = _parse_locale( pLang );
131 + return pLocales[ nType ];