printf("cannot create URI\n");
PRINTF("cannot create URI\n");
Wallet_Localize(char* genericString) {  nsresult ret;  nsAutoString v;  /* create a URL for the string resource file */  nsIIOService* pNetService = nsnull;  ret = nsServiceManager::GetService(kIOServiceCID, kIIOServiceIID,    (nsISupports**) &pNetService);  if (NS_FAILED(ret)) {    printf("cannot get net service\n");    return v.ToNewUnicode();  }  nsIURI *url = nsnull;  nsIURI *uri = nsnull;  ret = pNetService->NewURI(PROPERTIES_URL, nsnull, &uri);  if (NS_FAILED(ret)) {    printf("cannot create URI\n");    nsServiceManager::ReleaseService(kIOServiceCID, pNetService);    return v.ToNewUnicode();  }  ret = uri->QueryInterface(NS_GET_IID(nsIURI), (void**)&url);  NS_RELEASE(uri);  nsServiceManager::ReleaseService(kIOServiceCID, pNetService);  if (NS_FAILED(ret)) {    printf("cannot create URL\n");    return v.ToNewUnicode();  }  /* create a bundle for the localization */  nsIStringBundleService* pStringService = nsnull;  ret = nsServiceManager::GetService(kStringBundleServiceCID,    kIStringBundleServiceIID, (nsISupports**) &pStringService);  if (NS_FAILED(ret)) {    printf("cannot get string service\n");    NS_RELEASE(url);    return v.ToNewUnicode();  }  nsILocale* locale = nsnull;  nsIStringBundle* bundle = nsnull;  char* spec = nsnull;  ret = url->GetSpec(&spec);  NS_RELEASE(url);  if (NS_FAILED(ret)) {    printf("cannot get url spec\n");    nsServiceManager::ReleaseService(kStringBundleServiceCID, pStringService);    nsCRT::free(spec);    return v.ToNewUnicode();  }  ret = pStringService->CreateBundle(spec, locale, &bundle);  nsCRT::free(spec);  if (NS_FAILED(ret)) {    printf("cannot create instance\n");    nsServiceManager::ReleaseService(kStringBundleServiceCID, pStringService);    return v.ToNewUnicode();  }  nsServiceManager::ReleaseService(kStringBundleServiceCID, pStringService);  /* localize the given string */  nsAutoString   strtmp; strtmp.AssignWithConversion(genericString);  const PRUnichar *ptrtmp = strtmp.GetUnicode();  PRUnichar *ptrv = nsnull;  ret = bundle->GetStringFromName(ptrtmp, &ptrv);  NS_RELEASE(bundle);  if (NS_FAILED(ret)) {    printf("cannot get string from name\n");    return v.ToNewUnicode();  }  v = ptrv;  nsCRT::free(ptrv);  return v.ToNewUnicode();}