result = localeFactory->GetLocaleFromAcceptLanguage(acceptLangString,&locale); NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_get_locale failed"); NS_ASSERTION(locale!=NULL,"nsLocaleTest: factory_get_locale failed");     locale->AddRef();  catagory = new nsString("NSILOCALE_CTYPE"); value = new nsString();  result = locale->GetCatagory(catagory,value); NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_get_locale failed"); NS_ASSERTION(value->Length()>0,"nsLocaleTest: factory_get_locale failed");  locale->Release(); locale->Release();  delete catagory; delete value;
factory_get_locale(void){	nsresult			result;	nsILocaleFactory*	localeFactory;	nsILocale*			locale;	nsString*			catagory;	nsString*			value;	result = nsComponentManager::FindFactory(kLocaleFactoryCID,										(nsIFactory**)&localeFactory);	NS_ASSERTION(localeFactory!=NULL,"nsLocaleTest: factory_create_interface failed.");	NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_create_interface failed");	//	// get the application locale	//	result = localeFactory->GetApplicationLocale(&locale);	NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_get_locale failed");	NS_ASSERTION(locale!=NULL,"nsLocaleTest: factory_get_locale failed");	//	// test and make sure the locale is a valid Interface	//	locale->AddRef();	catagory = new nsString("NSILOCALE_CTYPE");	value = new nsString();	result = locale->GetCatagory(catagory,value);	NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_get_locale failed");	NS_ASSERTION(value->Length()>0,"nsLocaleTest: factory_get_locale failed");	locale->Release();	locale->Release();	delete catagory;	delete value;	//	// test GetSystemLocale	//	result = localeFactory->GetSystemLocale(&locale);	NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_get_locale failed");	NS_ASSERTION(locale!=NULL,"nsLocaleTest: factory_get_locale failed");	//	// test and make sure the locale is a valid Interface	//	locale->AddRef();	catagory = new nsString("NSILOCALE_CTYPE");	value = new nsString();	result = locale->GetCatagory(catagory,value);	NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_get_locale failed");	NS_ASSERTION(value->Length()>0,"nsLocaleTest: factory_get_locale failed");	locale->Release();	locale->Release();	delete catagory;	delete value;	localeFactory->Release();}