Bug #45816 --> fix i18n breakage of intl-accept pref by calling getLocalizedUnicharPref
r=tao git-svn-id: svn://10.0.0.236/trunk@74479 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -4225,15 +4225,16 @@ void nsImapProtocol::Language()
|
||||
// extract the desired language attribute from prefs
|
||||
nsresult rv = NS_OK;
|
||||
NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &rv);
|
||||
nsXPIDLCString acceptLanguages;
|
||||
nsXPIDLString acceptLanguages;
|
||||
if (NS_SUCCEEDED(rv) && prefs)
|
||||
prefs->CopyCharPref("intl.accept_languages", getter_Copies(acceptLanguages));
|
||||
prefs->GetLocalizedUnicharPref("intl.accept_languages", getter_Copies(acceptLanguages));
|
||||
|
||||
// we need to parse out the first language out of this comma separated list....
|
||||
// i.e if we have en,ja we only want to send en to the server.
|
||||
if (acceptLanguages)
|
||||
{
|
||||
nsCAutoString extractedLanguage (acceptLanguages);
|
||||
nsCAutoString extractedLanguage;
|
||||
extractedLanguage.AssignWithConversion(acceptLanguages);
|
||||
PRInt32 pos = extractedLanguage.FindChar(',', PR_TRUE);
|
||||
if (pos > 0) // we have a comma separated list of languages...
|
||||
extractedLanguage.Truncate(pos); // truncate everything after the first comma (including the comma)
|
||||
|
||||
Reference in New Issue
Block a user