View | Details | Raw Unified | Return to issue 8012
Collapse All | Expand All

(-)unx/source/app/i18n_im.cxx (+35 lines)
Lines 82-87 Link Here
82
#include <i18n_status.hxx>
82
#include <i18n_status.hxx>
83
#endif
83
#endif
84
84
85
#ifdef MACOSX
86
#include <osl/process.h>
87
#include <tools/string.hxx>
88
#endif
89
85
using namespace vcl;
90
using namespace vcl;
86
91
87
#ifndef _SAL_I18N_CALLBACK_HXX
92
#ifndef _SAL_I18N_CALLBACK_HXX
Lines 221-226 Link Here
221
SetSystemLocale( const char* p_inlocale )
226
SetSystemLocale( const char* p_inlocale )
222
{
227
{
223
	char *p_outlocale;
228
	char *p_outlocale;
229
230
#ifdef MACOSX
231
	// If p_inlocale is NULL, use current locale from libsal since
232
    // setlocale() always returns NULL when you pass NULL on Mac OS X
233
	if ( p_inlocale == NULL || *p_inlocale == NULL )
234
	{
235
		rtl_Locale* pLocale = NULL;
236
		osl_getProcessLocale( &pLocale );
237
		if ( pLocale ) 
238
		{
239
			ByteString aLocaleString( String( pLocale->Language ), RTL_TEXTENCODING_ASCII_US );
240
			ByteString aCountry( String( pLocale->Country ), RTL_TEXTENCODING_ASCII_US );
241
			ByteString aVariant( String( pLocale->Variant ), RTL_TEXTENCODING_ASCII_US );
242
 
243
			if( aCountry.Len() )
244
			{
245
				aLocaleString += "_";
246
				aLocaleString += aCountry;
247
			}
248
			if( aVariant.Len() )
249
			{
250
				aLocaleString += ".";
251
				aLocaleString += aVariant;
252
			}
253
254
			p_inlocale = aLocaleString.GetBuffer();
255
		}
256
	}
257
#endif
258
224
	if ( (p_outlocale = setlocale(LC_ALL, p_inlocale)) == NULL )
259
	if ( (p_outlocale = setlocale(LC_ALL, p_inlocale)) == NULL )
225
	{
260
	{
226
		fprintf( stderr, 
261
		fprintf( stderr, 

Return to issue 8012