1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/initLocale/src/InitialiseLocale.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,477 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include <e32base.h>
1.20 +#include <e32std.h>
1.21 +#include <e32err.h>
1.22 +#include <e32debug.h>
1.23 +#include <e32property.h>
1.24 +#include <bacntf.h>
1.25 +#include <bautils.h>
1.26 +#include "LocaleRepository.h"
1.27 +#include "InitialiseLocale.h"
1.28 +#include <hal.h>
1.29 +
1.30 +using namespace NCentralRepositoryConstants ;
1.31 +
1.32 +
1.33 +// Text constants for debug messages
1.34 +#ifdef _DEBUG
1.35 +_LIT (KBadChangeNotification, "InitialiseLocale: Bad Change Notification") ;
1.36 +#endif
1.37 +
1.38 +//
1.39 +// CExtendedLocaleManager::LocaleChanged
1.40 +//
1.41 +// Callback function to be attached to an instance of
1.42 +// CEnvironmentChangeNotifier to persist system locale data.
1.43 +//
1.44 +// Note that this has to be a static member function so that
1.45 +// it can be encapsulated into a TCallback object for use with
1.46 +// a CEnvironmentChangeNotifier - we get round this by passing
1.47 +// in a "this" pointer so that while remaining a static function
1.48 +// it can access all the member data anyway!
1.49 +TInt CExtendedLocaleManager::LocaleChanged(TAny* aPtr)
1.50 + {
1.51 + CExtendedLocaleManager* thisLocaleManager = (CExtendedLocaleManager *) aPtr ;
1.52 +
1.53 + if(!thisLocaleManager->iChangeNotifier)
1.54 + {
1.55 + #ifdef _DEBUG
1.56 + RDebug::Print(KBadChangeNotification);
1.57 + #endif
1.58 + return EFalse;
1.59 + }
1.60 +
1.61 +
1.62 + TInt stat = thisLocaleManager->iChangeNotifier->Change();
1.63 + if(stat & EChangesLocale)
1.64 + {
1.65 + //
1.66 + // System Locale data has been updated, persist
1.67 + // changes by writing to repository.
1.68 + TRAPD(err, thisLocaleManager->PersistLocaleL()); // No way to handle errors within this callback function, so ignore them
1.69 + if(err != KErrNone)
1.70 + {
1.71 + err=KErrNone;
1.72 + }
1.73 + }
1.74 + if(stat & EChangesSystemTime)
1.75 + {
1.76 + // changes by writing to HAL
1.77 + TInt ret = BaflUtils::PersistHAL();
1.78 + __ASSERT_DEBUG(ret == KErrNone, User::Invariant() );
1.79 + }
1.80 +
1.81 + return ETrue;
1.82 + }
1.83 +
1.84 +
1.85 +//
1.86 +// CExtendedLocaleManager::NewLC()
1.87 +// CExtendedLocaleManager::NewL()
1.88 +//
1.89 +// Usual 2 phase construction factory NewL NewLC classes
1.90 +//
1.91 +CExtendedLocaleManager* CExtendedLocaleManager::NewLC()
1.92 + {
1.93 + CExtendedLocaleManager* me = new(ELeave)CExtendedLocaleManager();
1.94 + CleanupStack::PushL(me) ;
1.95 + me->ConstructL() ;
1.96 + return me;
1.97 + }
1.98 +
1.99 +
1.100 +CExtendedLocaleManager* CExtendedLocaleManager::NewL()
1.101 + {
1.102 + CExtendedLocaleManager* me = CExtendedLocaleManager::NewLC() ;
1.103 + CleanupStack::Pop(me) ;
1.104 + return me;
1.105 + }
1.106 +
1.107 +
1.108 +
1.109 +
1.110 +//
1.111 +// CExtendedLocaleManager::CExtendedLocaleManager
1.112 +//
1.113 +// Constructor - doesn't really do anything!
1.114 +//
1.115 +CExtendedLocaleManager::CExtendedLocaleManager()
1.116 + {
1.117 + }
1.118 +
1.119 +
1.120 +
1.121 +//
1.122 +// CExtendedLocaleManager::ConstructL()
1.123 +//
1.124 +// Second phase constructor, initialises locale data from persisted (or default)
1.125 +// values in repository, creates an instance of CEnvironmentChangeNotifier, and
1.126 +// attaches the callback function, passing in our "this" pointer to get round the
1.127 +// requirement for the callback function to be a static.
1.128 +//
1.129 +void CExtendedLocaleManager::ConstructL()
1.130 + {
1.131 +
1.132 + TUid LocalePropertyUid;
1.133 + LocalePropertyUid.iUid = KUidLocalePersistProperties ;
1.134 +
1.135 + TInt error = RProperty::Define((TUint)EInitialisationState, RProperty::EInt,TSecurityPolicy::EAlwaysPass,TSecurityPolicy(ECapabilityWriteDeviceData));
1.136 + if(error != KErrAlreadyExists)
1.137 + {
1.138 + User::LeaveIfError(error);
1.139 +
1.140 + //If the property definition fails bail out. Note that if the
1.141 + // property has already been defined (because the locale initialisation code
1.142 + // has already been called) this call will return KErrAlreadyExists so locale
1.143 + // initialisation will only take place once.
1.144 + //
1.145 + // Set property to indicate initialisation in progress
1.146 + User::LeaveIfError(RProperty::Set(LocalePropertyUid, EInitialisationState, ELocaleInitialisationInProgress)) ;
1.147 +
1.148 + TUid LocaleRepositoryUid;
1.149 + LocaleRepositoryUid.iUid = KLocalePersistRepositoryUid;
1.150 +
1.151 +
1.152 + // Initialise system locale data from repository contents.
1.153 + CRepository* repository = CRepository::NewLC(LocaleRepositoryUid);
1.154 + TRAPD(err, InitialiseLocaleL(*repository)); //this function should no longer attempt to set the failure flag
1.155 + if (err != KErrNone)
1.156 + {
1.157 + // Failed to read DLL name, load corresponding Locale aspect or read value from DLL,
1.158 + // Set property to indicate initialisation failure and bail out!
1.159 + User::LeaveIfError(RProperty::Set(LocalePropertyUid, EInitialisationState, ELocaleInitialisationFailed)) ;
1.160 + }
1.161 + CleanupStack::PopAndDestroy(repository);
1.162 +
1.163 + }
1.164 +
1.165 + //After Initialisation, monitor the system locale for changes. If initialiselocale.exe is restarted,
1.166 + //then initialisation will not be executed, going to monitor directly.
1.167 +
1.168 + //
1.169 + // Create and install an CActiveScheduler to look after the active object
1.170 + // in the change notifier
1.171 + iActiveScheduler = new (ELeave) CActiveScheduler;
1.172 + CActiveScheduler::Install(iActiveScheduler);
1.173 +
1.174 +
1.175 + // Create the change notifier and install the callback function
1.176 + const TCallBack myCallBackFunction(&CExtendedLocaleManager::LocaleChanged, this);
1.177 + iChangeNotifier = CEnvironmentChangeNotifier::NewL(CActive::EPriorityStandard, myCallBackFunction);
1.178 + iChangeNotifier->Start();
1.179 +
1.180 + // Set property to indicate initialisation complete
1.181 + User::LeaveIfError(RProperty::Set(LocalePropertyUid, EInitialisationState, ELocaleInitialisationComplete));
1.182 +
1.183 + //now call RProcess::Rendezvous to indicate initialiseLocale is completed with no error
1.184 + RProcess().Rendezvous(KErrNone);
1.185 +
1.186 + // All ready to go! Start the active sheduler.
1.187 + CActiveScheduler::Start();
1.188 +
1.189 + }
1.190 +
1.191 +
1.192 +//
1.193 +// CExtendedLocaleManager::~CExtendedLocaleManager()
1.194 +//
1.195 +// Destructor to tidy up on shutdown (if needed!).
1.196 +CExtendedLocaleManager::~CExtendedLocaleManager()
1.197 + {
1.198 + delete iChangeNotifier;
1.199 + delete iActiveScheduler;
1.200 + }
1.201 +
1.202 +
1.203 +
1.204 +
1.205 +
1.206 +//
1.207 +// CExtendedLocaleManager::PersistLocaleL
1.208 +//
1.209 +// Persist system locale data by writing it to a repository
1.210 +void CExtendedLocaleManager::PersistLocaleL()
1.211 + {
1.212 + TUid LocaleRepositoryUid;
1.213 + LocaleRepositoryUid.iUid = KLocalePersistRepositoryUid ;
1.214 +
1.215 + CRepository* repository = CRepository::NewLC(LocaleRepositoryUid) ;
1.216 +
1.217 + // Refresh extended locale with current system settings
1.218 + iExtendedLocale.LoadSystemSettings();
1.219 +
1.220 + // Perform repository update in a transaction so that we're
1.221 + // guaranteed to retain consistent state of repository contents.
1.222 + User::LeaveIfError(repository->StartTransaction(CRepository::EReadWriteTransaction));
1.223 + repository->CleanupFailTransactionPushL();
1.224 +
1.225 + TBuf<KMaxFileName> DllName ;
1.226 +
1.227 + //
1.228 + // Locale DLL for Language Settings
1.229 + User::LeaveIfError(iExtendedLocale.GetLocaleDllName(ELocaleLanguageSettings, DllName));
1.230 + User::LeaveIfError(repository->Set(KLocaleLanguageDll, DllName));
1.231 +
1.232 + //
1.233 + // Locale DLL for Collation/Charset settings
1.234 + User::LeaveIfError(iExtendedLocale.GetLocaleDllName(ELocaleCollateSetting, DllName));
1.235 + User::LeaveIfError(repository->Set(KLocaleCollationDll, DllName));
1.236 +
1.237 + //
1.238 + // Locale DLL for Locale settings
1.239 + User::LeaveIfError(iExtendedLocale.GetLocaleDllName(ELocaleLocaleSettings, DllName));
1.240 + User::LeaveIfError(repository->Set(KLocaleLocaleDll, DllName));
1.241 +
1.242 + //
1.243 + #ifndef SYMBIAN_DISTINCT_LOCALE_MODEL
1.244 + // Locale DLL for Time and date settings
1.245 + User::LeaveIfError(iExtendedLocale.GetLocaleDllName(ELocaleTimeDateSettings, DllName));
1.246 + User::LeaveIfError(repository->Set(KLocaleTimeDateDll, DllName));
1.247 + #endif
1.248 +
1.249 + //
1.250 + // Locale customisations (contents of embedded TLocale)
1.251 + TLocale* locale = iExtendedLocale.GetLocale() ;
1.252 + User::LeaveIfError(repository->Set(KLocaleCountryCode, locale->CountryCode()));
1.253 + User::LeaveIfError(repository->Set(KLocaleUtcOffset, User::UTCOffset().Int()));
1.254 + User::LeaveIfError(repository->Set(KLocaleDateFormat, locale->DateFormat()));
1.255 + User::LeaveIfError(repository->Set(KLocaleTimeFormat, locale->TimeFormat()));
1.256 + User::LeaveIfError(repository->Set(KLocaleCurrencySymbolPosition, locale->CurrencySymbolPosition()));
1.257 + User::LeaveIfError(repository->Set(KLocaleCurrencySpaceBetween, locale->CurrencySpaceBetween()));
1.258 + User::LeaveIfError(repository->Set(KLocaleCurrencyDecimalPlaces, locale->CurrencyDecimalPlaces()));
1.259 + User::LeaveIfError(repository->Set(KLocaleCurrencyNegativeInBrackets, locale->CurrencyNegativeInBrackets()));
1.260 + User::LeaveIfError(repository->Set(KLocaleCurrencyTriadsAllowed, locale->CurrencyTriadsAllowed()));
1.261 + User::LeaveIfError(repository->Set(KLocaleThousandsSeparator, (TInt)locale->ThousandsSeparator()));
1.262 + User::LeaveIfError(repository->Set(KLocaleDecimalSeparator, (TInt)locale->DecimalSeparator()));
1.263 +
1.264 + TInt index ;
1.265 + for (index = 0; index < KMaxDateSeparators; index++)
1.266 + {
1.267 + User::LeaveIfError(repository->Set(KLocaleDateSeparatorBase+index, (TInt)locale->DateSeparator(index)));
1.268 + }
1.269 +
1.270 + for (index = 0; index < KMaxTimeSeparators; index++)
1.271 + {
1.272 + User::LeaveIfError(repository->Set(KLocaleTimeSeparatorBase +index, (TInt)locale->TimeSeparator(index)));
1.273 + }
1.274 +
1.275 + User::LeaveIfError(repository->Set(KLocaleAmPmSpaceBetween, locale->AmPmSpaceBetween()));
1.276 + User::LeaveIfError(repository->Set(KLocaleAmPmSymbolPosition, locale->AmPmSymbolPosition()));
1.277 + User::LeaveIfError(repository->Set(KLocaleWorkDays, (TInt)locale->WorkDays()));
1.278 + User::LeaveIfError(repository->Set(KLocaleStartOfWeek, locale->StartOfWeek()));
1.279 + User::LeaveIfError(repository->Set(KLocaleClockFormat, locale->ClockFormat()));
1.280 + User::LeaveIfError(repository->Set(KLocaleUnitsGeneral, locale->UnitsGeneral()));
1.281 + User::LeaveIfError(repository->Set(KLocaleUnitsDistanceShort, locale->UnitsDistanceShort()));
1.282 + User::LeaveIfError(repository->Set(KLocaleUnitsDistanceLong, locale->UnitsDistanceLong()));
1.283 + User::LeaveIfError(repository->Set(KLocaleCurrencyNegativeFormat, locale->NegativeCurrencyFormat()));
1.284 + User::LeaveIfError(repository->Set(KLocaleCurrencyNegativeLoseSpace, locale->NegativeLoseSpace()));
1.285 + User::LeaveIfError(repository->Set(KLocaleCurrencySymbolOpposite, locale->NegativeCurrencySymbolOpposite()));
1.286 +
1.287 + TCurrencySymbol currencySymbol ;
1.288 + currencySymbol.Set() ;
1.289 + User::LeaveIfError(repository->Set(KLocaleCurrencySymbol, currencySymbol));
1.290 +
1.291 + for (index = 0; index < 3; index++)
1.292 + {
1.293 + User::LeaveIfError(repository->Set(KLocaleLanguageDowngradeBase+index, locale->LanguageDowngrade(index)));
1.294 + }
1.295 +
1.296 + User::LeaveIfError(repository->Set(KLocaleDigitType, locale->DigitType()));
1.297 + User::LeaveIfError(repository->Set(KLocaleDeviceTimeState, locale->DeviceTime()));
1.298 +
1.299 + // Completed sucessfully, commit transaction and close registry
1.300 + TUint32 transactionErr ;
1.301 + User::LeaveIfError(repository->CommitTransaction(transactionErr));
1.302 + CleanupStack::Pop(); // pop repository->CleanupFailTransactionPushL item
1.303 + CleanupStack::PopAndDestroy (repository);
1.304 + }
1.305 +
1.306 +
1.307 +
1.308 +
1.309 +//
1.310 +// Initialise System Locale data from persisted (or default) data held in a
1.311 +//repository.
1.312 +void CExtendedLocaleManager::InitialiseLocaleL(CRepository& aRepository)
1.313 + {
1.314 +
1.315 + // Get names of DLLs to be loaded
1.316 + TBuf<KMaxFileName> DllName ;
1.317 +
1.318 + #ifndef SYMBIAN_DISTINCT_LOCALE_MODEL
1.319 + // Collation/Charset settings
1.320 + User::LeaveIfError(aRepository.Get(KLocaleCollationDll, DllName));
1.321 + User::LeaveIfError(iExtendedLocale.LoadLocaleAspect(ELocaleCollateSetting,DllName));
1.322 +
1.323 + // Language Settings
1.324 + User::LeaveIfError(aRepository.Get(KLocaleLanguageDll, DllName));
1.325 + User::LeaveIfError(iExtendedLocale.LoadLocaleAspect(ELocaleLanguageSettings,DllName));
1.326 +
1.327 + // Locale settings
1.328 + User::LeaveIfError(aRepository.Get(KLocaleLocaleDll, DllName));
1.329 + User::LeaveIfError(iExtendedLocale.LoadLocaleAspect(ELocaleLocaleSettings,DllName));
1.330 +
1.331 + // Time and Date settings
1.332 + User::LeaveIfError(aRepository.Get(KLocaleTimeDateDll, DllName));
1.333 + User::LeaveIfError(iExtendedLocale.LoadLocaleAspect(ELocaleTimeDateSettings,DllName));
1.334 +
1.335 + #else
1.336 +
1.337 + User::LeaveIfError(aRepository.Get(KLocaleCollationDll, DllName));
1.338 + User::LeaveIfError(iExtendedLocale.LoadLocaleAspect(DllName));
1.339 +
1.340 + User::LeaveIfError(aRepository.Get(KLocaleLanguageDll, DllName));
1.341 + User::LeaveIfError(iExtendedLocale.LoadLocaleAspect(DllName));
1.342 +
1.343 + User::LeaveIfError(aRepository.Get(KLocaleLocaleDll, DllName));
1.344 + User::LeaveIfError(iExtendedLocale.LoadLocaleAspect(DllName));
1.345 +
1.346 + #endif
1.347 +
1.348 + iExtendedLocale.SaveSystemSettings();
1.349 +
1.350 + // Locale customisations
1.351 + TLocale* locale = iExtendedLocale.GetLocale() ;
1.352 +
1.353 + TInt intValue ;
1.354 + User::LeaveIfError(aRepository.Get(KLocaleCountryCode, intValue));
1.355 + locale->SetCountryCode(intValue) ;
1.356 +
1.357 + User::LeaveIfError(aRepository.Get(KLocaleUtcOffset, intValue));
1.358 + User::SetUTCOffset(intValue) ;
1.359 +
1.360 + User::LeaveIfError(aRepository.Get(KLocaleDateFormat, intValue));
1.361 + locale->SetDateFormat((TDateFormat)intValue) ;
1.362 +
1.363 + User::LeaveIfError(aRepository.Get(KLocaleTimeFormat, intValue));
1.364 + locale->SetTimeFormat((TTimeFormat)intValue) ;
1.365 +
1.366 + User::LeaveIfError(aRepository.Get(KLocaleCurrencySymbolPosition, intValue));
1.367 + locale->SetCurrencySymbolPosition((TLocalePos)intValue) ;
1.368 +
1.369 + User::LeaveIfError(aRepository.Get(KLocaleCurrencySpaceBetween, intValue));
1.370 + locale->SetCurrencySpaceBetween((TBool)intValue) ;
1.371 +
1.372 + User::LeaveIfError(aRepository.Get(KLocaleCurrencyDecimalPlaces, intValue));
1.373 + locale->SetCurrencyDecimalPlaces((TBool)intValue) ;
1.374 +
1.375 + User::LeaveIfError(aRepository.Get(KLocaleCurrencyNegativeInBrackets, intValue));
1.376 + locale->SetCurrencyNegativeInBrackets((TBool)intValue) ;
1.377 +
1.378 + User::LeaveIfError(aRepository.Get(KLocaleCurrencyTriadsAllowed, intValue));
1.379 + locale->SetCurrencyTriadsAllowed((TBool)intValue) ;
1.380 +
1.381 + TCurrencySymbol currencySymbol ;
1.382 + User::LeaveIfError(aRepository.Get(KLocaleCurrencySymbol, currencySymbol));
1.383 + iExtendedLocale.SetCurrencySymbol(currencySymbol) ;
1.384 +
1.385 + User::LeaveIfError(aRepository.Get(KLocaleThousandsSeparator, intValue));
1.386 + locale->SetThousandsSeparator(intValue) ;
1.387 +
1.388 + User::LeaveIfError(aRepository.Get(KLocaleDecimalSeparator, intValue));
1.389 + locale->SetDecimalSeparator(intValue) ;
1.390 +
1.391 + TInt index ;
1.392 + for (index = 0; index < KMaxDateSeparators; index++)
1.393 + {
1.394 + User::LeaveIfError(aRepository.Get(KLocaleDateSeparatorBase+index, intValue));
1.395 + locale->SetDateSeparator(intValue, index) ;
1.396 + }
1.397 +
1.398 + for (index = 0; index < KMaxTimeSeparators; index++)
1.399 + {
1.400 + User::LeaveIfError(aRepository.Get(KLocaleTimeSeparatorBase+index, intValue));
1.401 + locale->SetTimeSeparator(intValue, index) ;
1.402 + }
1.403 +
1.404 + User::LeaveIfError(aRepository.Get(KLocaleAmPmSpaceBetween, intValue));
1.405 + locale->SetAmPmSpaceBetween(intValue) ;
1.406 +
1.407 + User::LeaveIfError(aRepository.Get(KLocaleAmPmSymbolPosition, intValue));
1.408 + locale->SetAmPmSymbolPosition((TLocalePos)intValue) ;
1.409 +
1.410 + User::LeaveIfError(aRepository.Get(KLocaleWorkDays, intValue));
1.411 + locale->SetWorkDays(intValue) ;
1.412 +
1.413 + User::LeaveIfError(aRepository.Get(KLocaleStartOfWeek, intValue));
1.414 + locale->SetStartOfWeek((TDay)intValue) ;
1.415 +
1.416 + User::LeaveIfError(aRepository.Get(KLocaleClockFormat, intValue));
1.417 + locale->SetClockFormat((TClockFormat)intValue) ;
1.418 +
1.419 + User::LeaveIfError(aRepository.Get(KLocaleUnitsGeneral, intValue));
1.420 + locale->SetUnitsGeneral((TUnitsFormat)intValue) ;
1.421 +
1.422 + User::LeaveIfError(aRepository.Get(KLocaleUnitsDistanceShort, intValue));
1.423 + locale->SetUnitsDistanceShort((TUnitsFormat)intValue) ;
1.424 +
1.425 + User::LeaveIfError(aRepository.Get(KLocaleUnitsDistanceLong, intValue));
1.426 + locale->SetUnitsDistanceLong((TUnitsFormat)intValue) ;
1.427 +
1.428 + User::LeaveIfError(aRepository.Get(KLocaleCurrencyNegativeFormat, intValue));
1.429 + locale->SetNegativeCurrencyFormat((TLocale::TNegativeCurrencyFormat)intValue) ;
1.430 +
1.431 + User::LeaveIfError(aRepository.Get(KLocaleCurrencyNegativeLoseSpace, intValue));
1.432 + locale->SetNegativeLoseSpace(intValue) ;
1.433 +
1.434 + User::LeaveIfError(aRepository.Get(KLocaleCurrencySymbolOpposite, intValue));
1.435 + locale->SetNegativeCurrencySymbolOpposite(intValue) ;
1.436 +
1.437 + for (index = 0; index < 3; index++)
1.438 + {
1.439 + User::LeaveIfError(aRepository.Get(KLocaleLanguageDowngradeBase+index, intValue));
1.440 + locale->SetLanguageDowngrade(index, (TLanguage)intValue) ;
1.441 + }
1.442 +
1.443 + User::LeaveIfError(aRepository.Get(KLocaleDigitType, intValue));
1.444 + locale->SetDigitType((TDigitType)intValue) ;
1.445 +
1.446 + User::LeaveIfError(aRepository.Get(KLocaleDeviceTimeState, intValue));
1.447 + locale->SetDeviceTime((TLocale::TDeviceTimeState)intValue) ;
1.448 +
1.449 + //
1.450 + // Sucessfully loaded a complete set of persisted/default Locale data - write to
1.451 + // system locale data.
1.452 + User::LeaveIfError(iExtendedLocale.SaveSystemSettings());
1.453 +
1.454 + }
1.455 +
1.456 +
1.457 +// Entry point for the executable
1.458 +TInt E32Main()
1.459 + {
1.460 + TInt result = KErrNone;
1.461 + CTrapCleanup* tc = CTrapCleanup::New();
1.462 + if(!tc)
1.463 + {
1.464 + User::Panic(KLocaleInitPanic, KErrNoMemory) ;
1.465 + }
1.466 + __UHEAP_MARK;
1.467 +
1.468 + CExtendedLocaleManager* localeManager = NULL ;
1.469 + TRAPD(err, (localeManager = CExtendedLocaleManager::NewL()));
1.470 + if(err != KErrNone)
1.471 + {
1.472 + result = err;
1.473 + }
1.474 + __UHEAP_MARKEND;
1.475 +
1.476 + delete localeManager;
1.477 + delete tc;
1.478 + return result;
1.479 + }
1.480 +